C# Socket Stuck in CLOSE_WAIT – RFID Reader FX9600 Driver Not Releasing Connection

J Johnny Kortbawi 2 weeks 3 days ago
27 0 0

Issue Description:
I’m working on an RFID driver in C# that communicates over a network using TCP. However, after the reader is disconnected and then reconnected, a never-ending chain of sockets are being used to connect to the FX9600 RFID reader even after a connection has been established. The other sockets remain in the CLOSE_WAIT state, which eventually causes resource exhaustion. 
 

Question:
How can the TCP sockets be closed properly to prevent them from getting stuck in CLOSE_WAIT as a result from reconnecting the RFID reader? 

Any help or guidance would be greatly appreciated.

CONTACT
Can’t find what you’re looking for?