Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Closing a TCP/IP component connection the right way
#7
Hi again,
I am working on a Push notification service that uses a mix of indy HTTP and TCP components. So, I use HTTP to pull any pending large number of messages to the user and TCP on both sides to push and receive anything written to the socket. Let's say that the connection dropped for any reason.

Now, on the client side, I have a timer or a worker thread looping to read anything that gets sent to the client but I am always checking if the connection is on via the "Connected" method. My question is, is that enough to know that the connection has been lost, or do I need to read from the socket to raise the proper errors accordingly? Knowing that the client app should not raise exceptions in the user's face everything should be handled internally.
Reply


Messages In This Thread
RE: Closing a TCP/IP component connection the right way - by Ahmed Sayed - 07-10-2024, 12:09 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)