views:

365

answers:

1

Hello,

Why doesn't sockets/remoting have the ability to work smoothly when disconnected and reconnected repeatedly? I'm forced to kill both the server and client application and reopen them again.

What is the fix for this issue?

Thanks

Edit: There's no one problem with this issue. Different errors come up...Sometimes,the application crashes and sometimes does does not respond

+1  A: 

The OS will hold socket references for a defined time period to handle any messages remaining on the network/sent from clients. To rebind to a particular port number after shutdown you should have a look at specifying the SO_REUSEADDR option when defining your sockets.

Brian Agnew