This is in C#.
If i start a listen socket with the cable unconnected and then subsequently make physical connection ido not get a callback. I am forced to recall/create a new listen socket. This does work but i have a thread count increase everytime i create a new listen socket. I cannot seem kill/dispose a listen socket that never received a callback. What am i doing wrong or how do i resolve this problem?
example code below..
StartListener()
{
listener.Bind(localEP);
listener.Listen(1);
listener.BeginAccept(
new AsyncCallback(acceptCallback), listener);
state.listener = listener;
}
public void acceptCallback(IAsyncResult ar)
{
Socket listener = (Socket)ar.AsyncState;
Socket handler = listener.EndAccept(ar); //EndAccept returns socket that can}