After calling the BeginReceice() method of a UdpClient object, the provided receive callback method is called when data is ready to read.However, when the UdpClient is closed without having anything received yet, e.g. because the program is being shut down, the receive callback method is also called after returning from the UdpClient.Close() method.An exception is raised within the callback method when the udp object is being accessed because it's already disposed. To work around this, the program must maintain some kind of flags to avoid accessing the UdpClient object in the callback in this situation.I haven't checked the same for other communication objects like TcpClient etc. Might be the same there.