I´am using the "webwrite" function for making requests to a Matlab Production Server, the problem is that when the server takes too long to answer(and finally does answer) the function seems not to get the response and keep bloking until timeout, how can i solve the problem??? Thanks in advance.

댓글 수: 2

Kojiro Saito
Kojiro Saito 2019년 8월 31일
Are you using actual Production Server instance, or on MATLAB (using Test Client mode)?
Fidel Ernesto Díaz Andino
Fidel Ernesto Díaz Andino 2019년 9월 2일
I´m using Test Client mode but according to it, is sending a response to client, it puts Complete on the Status

댓글을 달려면 로그인하십시오.

답변 (1개)

Kojiro Saito
Kojiro Saito 2019년 9월 3일

0 개 추천

As this document is an example of calling MPS test client from MATLAB using matlab.net.http, but the description "Start a separate session of the MATLAB desktop. This is because you cannot send a POST request from the same MATLAB session that is running the testing interface." is also true to webwrite.
If you're launching MPS test client mode, you need to launch another MATLAB process to call webwrite. You can find MPS test client will accept incoming requsts as soon as webwrite is called from another MATLAB process.

댓글 수: 4

Fidel Ernesto Díaz Andino
Fidel Ernesto Díaz Andino 2019년 9월 3일
편집: Fidel Ernesto Díaz Andino 2019년 9월 3일
Yes of course i´m sending the requests from another session, the "webwrite" function works fine when the request takes a little time, when not, and i´m talking about an hour or more, i mind like this: i send the request(using webwrite), the server makes wherever i command to do after it finishes it send a response, all is fine, when that processing in the server takes too long(and finally respond) the function "webwrite" on client seem not to see, not to capture that response, and it stay blocking the Matlab(client).
Kojiro Saito
Kojiro Saito 2019년 9월 4일
As the document of webwrite says, maximum Timeout is 2147.483647 seconds (about 35 minutes), so your server takes more than that, webwrite cannot wait the connection.
So, there are two options.
  1. Try matlab.net.http.HTTPOptions and call MPS test client from matlab.net.http interface.
  2. Try MATLAB Production Server's asynchronous request on MPS and call it using webwrite. Currently Test Client does not support async request, so you need to call MPS server instead of test client mode.
So i tested matlab.net.http.httpoptions class using the example you mentioned and the result is the same when the processing on server is too long, when the server response the client dont see the answer, so now i started to believe that the problems is on the server alias MPS test client mode, and know that the time was imposed be me, just to test i paused for 30 minutes in my function and then give the response as shown:
function [responseToClients] = casi_functions(args)
pause(1800);
responseToClients = {[32 435 546 67]};
end
Fidel Ernesto Díaz Andino
Fidel Ernesto Díaz Andino 2019년 9월 5일
편집: Fidel Ernesto Díaz Andino 2019년 9월 5일
Hi i tested with others apps (to isolate the problem) and also get the same result, i have a fixed time now, when the process takes more than 20 minutes the MPS test client mode does not response to client.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Installation에 대해 자세히 알아보기

제품

릴리스

R2018b

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by