|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Disposing unused socketsHi !
My socket server doesn't remove the socket if a client is disconnected suddenly (network problems etc.) If the client starts the app again, it is existing two times in the servers hashtable. I don't know how to "dispose" the socket completely. Any ideas ? thanks a lot Christoph duesmann I don't know how and if you are doing a shutdown on both sides.
Can you show a scheme of you code? Are you using some finally or using statement? -tom Christoph Duesmann ha scritto: Show quoteHide quote > Hi ! > > My socket server doesn't remove the socket if a client is disconnected > suddenly (network problems etc.) > If the client starts the app again, it is existing two times in the servers > hashtable. > > I don't know how to "dispose" the socket completely. > > Any ideas ? > > thanks a lot > > Christoph duesmann Do you check for a read of 0 bytes? This is how the Berkeley interface
identifies an unexpected (not shutdown) socket disconnection. Mike Ober. <tommaso.gasta***@uniroma1.it> wrote in message Show quoteHide quote news:1154014319.020227.254940@m73g2000cwd.googlegroups.com... > > I don't know how and if you are doing a shutdown on both sides. > Can you show a scheme of you code? Are you using some finally or using > statement? > > -tom > > Christoph Duesmann ha scritto: > >> Hi ! >> >> My socket server doesn't remove the socket if a client is disconnected >> suddenly (network problems etc.) >> If the client starts the app again, it is existing two times in the >> servers >> hashtable. >> >> I don't know how to "dispose" the socket completely. >> >> Any ideas ? >> >> thanks a lot >> >> Christoph duesmann > Hi !
Attached you will find two files: frmMain contains the code which is responsible for waiting for connections. When a client want's to connect a new instance of UserConnection ist created. Hope this helps to understand. Thanks Christoph Duesmann <tommaso.gasta***@uniroma1.it> schrieb im Newsbeitrag Show quoteHide quote news:1154014319.020227.254940@m73g2000cwd.googlegroups.com... [attached file: Code.zip]> > I don't know how and if you are doing a shutdown on both sides. > Can you show a scheme of you code? Are you using some finally or using > statement? > > -tom > > Christoph Duesmann ha scritto: > >> Hi ! >> >> My socket server doesn't remove the socket if a client is disconnected >> suddenly (network problems etc.) >> If the client starts the app again, it is existing two times in the >> servers >> hashtable. >> >> I don't know how to "dispose" the socket completely. >> >> Any ideas ? >> >> thanks a lot >> >> Christoph duesmann > >
Rank newbie question - Class or Function?
VB Code question Removing multiple items from a multi-select ListView how to speed up collections iteration Suppressing redraw of PictureBox after moving? Dynamically adding in User Controls Using ListView's VirtualMode inverse color How to access and use Unmanaged Code Updating DataTable bound to a DataGridView |
|||||||||||||||||||||||