Socket disposing after some time

  • Thread starter Thread starter deepak
  • Start date Start date
D

deepak

Hi There,

i have an socket server and client , some how the listener socket is
getting disposed after some time for some reason .
is there any expiry period associated with the socket , how do i set/
control the expiry period if any .

i am using Socket class of .net 2.0

the error ocuured was

Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset,
Int32 size, SocketFlags socketFlags, SocketError& errorCode)
at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset,
Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.Socket.Send(Byte[] buffer)
at PubSub.ChannelListener.receive(String msg)


any suggestions/comments will be highly helpful.


Thanks
Deepak
 
since the reference of this socket is in main class , i do not think
this would be because GC is collecting it .
 
Back
Top