![](http://www.gravatar.com/avatar/118637d4005edd4f149551b8371b13a6?s=100&d=http%3A%2F%2Fforums.netduino.com%2Fpublic%2Fstyle_images%2Fmaster%2Fprofile%2Fdefault_large.png)
Best Answer David Karlas, 15 January 2014 - 11:36 AM
I suggest you using socket.Poll(1000,SelectMode.Read); for more details see http://msdn.microsof...y/cc532890.aspx
So instead of socket.Accept() do this:
class MyTcpListener;
{
public bool StopListening=false;
private Socket socket;
public Socket Accept()
{
while(!socket.Poll(1000,SelectMode.Read))
{
if(StopListening)
return null;
}
return socket.Accept();
}
}
Ofcource this is pretty stupid example you can do much better...
Go to the full post![](http://forums.netduino.com/public/style_images/master/right_white_10px.png)