Author Topic: cleaning up a socket with no connection  (Read 14795 times)

Offline neil

  • Sr. Member
  • ****
  • Posts: 438
    • View Profile
Re: cleaning up a socket with no connection
« Reply #15 on: April 21, 2014, 05:29:16 PM »
Hi Mark
  When i only reuse sockets that the state is marked TCP_STATE_CLOSED, all works well. A set of sockets are used every ten seconds, and if the socket cant be reused straight away i simply get the next free one, and within the next ten seconds any ones that werent available are now marked TCP_STATE_CLOSED and are available. Do you see any problems using this method, i cant see me needing any more sockets that are available in the pool.

regards
neil


Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: cleaning up a socket with no connection
« Reply #16 on: April 22, 2014, 02:20:12 PM »
Hi Neil

I an not clear on why reusing a waiting socket is a problem but your method seems good. If it is suitable I seen no problems.

In case you find the need to be able to immediately reuse the waiting sockets I suggest that you send me your project so that I can check out what is behaving differently with your version.

Regards

Mark