"Silent" IP connections?
annuello
Posts: 294
Is there a way to use IP_CLIENT_OPEN() so that successful IP connects (& disconnects) operate in a "silent" mode? As in, when I telnet into my master and issue the "msg on" command, I get several lines reporting to me that my IP connection opened & closed okay. E.g.
I figured there must be a way, since I've also got RMS on the same master and it never appears in my telnet sessions unless my RMS server is down or the RMS module can't make the connection. I presume is uses the i!-ConenctLinxEngineMod.tko to handle the IP connection to the server, so perhaps the magic answer is hiding inside that .tko file.
Roger McLean
Swinburne University
Welcome to NetLinx v3.21.354 Copyright AMX Corp. 1999-2006 >msg on Extended diagnostic information messages turned on. >(0949642087) Connected Successfully (0949642088) CIpEvent::OnLine 0:11:12 (0949642592) Exiting TCP Read thread - closing this socket for local port 11 (0949642593) CIpEvent::OffLine 0:11:12 (0949662082) Connected Successfully (0949662083) CIpEvent::OnLine 0:11:12 (0949662586) Exiting TCP Read thread - closing this socket for local port 11 (0949662587) CIpEvent::OffLine 0:11:12 msg off Extended diagnostic information messages turned off. >My IP code is polling another device every 20 seconds or so. The MSG ON info is great for development & debugging, but once everything is working okay I'd rather set my code to a "silent" mode which only reports problems with the IP connections, not success as well. I'd prefer this change to be dynamic rather than compile time, but would be happy for either solution. With a 20 second poll, you can imagine what a pain it would be trying to debug other devices/code on the master.
I figured there must be a way, since I've also got RMS on the same master and it never appears in my telnet sessions unless my RMS server is down or the RMS module can't make the connection. I presume is uses the i!-ConenctLinxEngineMod.tko to handle the IP connection to the server, so perhaps the magic answer is hiding inside that .tko file.
Roger McLean
Swinburne University
0
Comments
The device is an application running on a PC, and I'm using HTTP to connect to it. As such, I can't really see how I can hold the connection open to the device since at the end of an HTTP transaction you are supposed to disconnect.
Did you ever comes across Connection Refuse?
I always meet up with
IPSocketManConnectTask - Connection Refuse problem... why this thing happen?
This is the most severe problem once it encounter during runtime. You cannot do anything until reset the master controller. How could we overcome this issue? Is there a way to force open the port?
I'm using IP connection for most of the device i had when there is network port available. Even the kramer switcher....comes with Lanport serial convertor meet the same problem.
I had tried to open the port without closing it, however it still fail at certain time during runtime. Once the port fail to open or connection refuse. The only solution is the reset the switcher or the master controller.
Soon i had got the idea from a programmer to do Timeline event. By open and closing it at certain interval. This idea seems work. Yet this does not get rid of the problem. By introducing a timeline to open and closing the port seems engage higher chances to fail in the connection.
Anyone with a good suggestion to overcome this problem.
Most of the system installed are for the goverment meeting and boardroom...
10 second of disconnected line was real bad.....and it reli jeopardise the image of the product.
As they highly regards it as one of the most reliable....piece of equipment....
No down time is expected. Maybe there is a way to overcome the re-connection issue.
Regards
Alvin
Check your set up an make sure your IP and ports are correct.
alvinyow wrote: I'm not sure if yor're talking HTTP but if it's HTTP open the connection and send your GET, use a variable in your ONLINE & OFFLINE & ONERROR event handlers to track whether you're on or off line. If you need to send more requests use the variable to determine the timing.
if(!nIPDev_Online && nOtherRequestPending)
{
//send next request
}
If it's not HTTP most devices can maintain the connection indefinitely and you only need to put a re-connect function call in the offline handler to re-connect you should the connection drop.
On a simple IP_CLIENT connection that does a GET to log some stuff to a database via a PHP application, the online/offline trap I set up to chew through and send buffer data worked flawlessly for almost a month, logging almost 2000 events in that time. Then, one day, one or both of the "variable = 1" statements in the Offline event failed to trigger, and the logging stopped. All I had to do to get it going again (and flush the buffer which was full and holding the last 30 or so events), was go into debug and change one of the two variable values. It's been running fine again for 3 more days now. And now that I'm posting about it, I've just realized that I'm not trapping and handling the possibility that the PHP server is not responding. I think I just solved that one.
On a fairly complex IP_SERVER setup that acts as a gateway to a PHP-based web interface, I've found that the controller is just too slow to respond to more than one connection per web page load. I would much rather be able to put the results of 2 different calls to the controller on one web page, but the 2nd call invariably fails. (And here I thought using Filemaker as a back-end to a PHP-based web app was slow!) With an NI-3100 controller data is usually returned and the connection is closed in well under a second, but it takes 2-3 seconds before I can get another connection. Of course there's a chance this could be due to poor programming, but it sounds just like what dhawthorne mentioned.
One other note, for IP_CLIENT connections, I've programmed a Proof-of-concept round-robin pool of IP connections that can be used. I defined 4 IP devices, put them in an array, and then used a 4-character buffer and GET_BUFFER_STRING to grab the index of the first available IP device from the buffer. When the OFFLINE event happens, it puts it's index number back into the buffer, at the end. With a pool of IP devices, you can make some pretty rapid IP transactions. It might be a good workaround to the problem dhawthorne noted. I haven't put it into production yet, but I might try something similar for my IP_SERVER problem stated above.
The chattiness of the connections doesn't bother me. There are lots of good tools out there for log parsing and analysis.
You mean just do an open port cmd and use the ONLINE & OFFLINE & ONERROR event handler to maintain the reconnection?
Hello!
Anybody have solution for this situation? Im write module that request device every five seconds by http(that close connection after GET method). And diagnistic flooded with ofline/online messages