KenR 29 Posted December 6, 2022 Hi, I have been using TWSocket very successfully for a few years now in a service. It listens for and processes HL7 messages. At one hospital however it seems to hang while it is seemingly not doing anything. I am using a TICSLogger but am not getting any errors. I am presuming this is a socket error. The NHS typically rum a lot of processes on rather underpowered old hardware. Can anyone please point me in the right area as to how I might trap, report and, preferably, have the socket start listening again. Thanks in advance for any help given. Ken Share this post Link to post
Angus Robertson 577 Posted December 6, 2022 Server sockets tend to only raise errors when they are processing data, not sitting idle listening. There are really only two solutions, send wake up data periodically to the server socket, or check a last received time stamp if you expect data every five minutes or something, or perhaps a combination of the two. Wake up testing can be added with a few lines of code using TSslHttpRest for HTTP or TIcsIpStrmLog for simple ASCII which I believe HL7 uses. I had a problem with one of my web servers not listening after restart and added this in half an hour. Then discovered I was incorrectly setting a firewall rule on startup. If TWSocket has stopped listening, you can try closing and re-opening, but it's safer to restart the application, which is easy with a Windows service, just set service properties to restart after five seconds, and stop it. My servers send an email when this happens so I know to check the logs for why, the OverbyteIcsDDWebService sample illustrates this. Angus Share this post Link to post