Home AMX User Forum AMX Technical Discussion
Options

strange command speed handling between nx and webserver

Hi all
NX controller that communicates with a webserver via a rest api.
NX sends command > websrv responds with data > NX parses feedback

All works fine except when we fire the next command (nx > wwebsrv) within 0.5 second.
The websrv misses almost always the second command.
The minimum time between 2 commands may not be less than 5 seconds.

But the problem does not happen when we use fiddler or another external stress-test-app.

What we've tested:

1.
nx > websrv
ip_client_open & using port 80
= problem

2.
nx > websrv
tls_client_open & using port 443
= problem

3.
nx > fiddler (kind of wireshark) > websrv
ip_client_open & using port 8888 (fiddler port)
= WORKS FINE (3 commands fired from nx with interval of 0.2 seconds)

4.
external prog > websrv
5 commands within 0.5 seconds
= WORKS FINE (all are executed, i.e. customer sees them executed in the log files of the web app)

If we get this solved, communication between nx and websrv will be mandatory in https (443).
So we'll use ...
tls_client_open(websrv_dv.port,websrv_ipaddress,websrv_port,1)
The 1 at the end means ...
mode - 0: TLS_VALIDATE_CERTIFICATE (perform certificate validation), 1: TLS_IGNORE_CERTIFICATE_ERRORS (connect to the remote site while ignoring certificate errors or mismatches)

Anyone that has a tip after reading the above ?

Comments

  • Options

    Are you checking to see if the ip connection is already open before you call client_open()? If its already open you should be able to just send the string directly to the port instead of caching it an calling client_open() and waiting for the connection online event.

Sign In or Register to comment.