UdpClient receiving and sending at the same time

Posted by SoMoS on Stack Overflow See other posts from Stack Overflow or by SoMoS
Published on 2010-04-22T10:18:43Z Indexed on 2010/04/22 10:23 UTC
Read the original article Hit count: 363

Hello,

I am maintaining other's code and its using the class UdpClient. The code declares one instance of UdpClient and receives data continuosly using the UdpClient.Receive().

When data is received it is processed in another thread and the UdpClient calls Receive() again. At the same time when the data is processed the same client is sending a response back.

Question: Is this a bug? I think so because UdpClient is not thread safe so you can not call two methods at the same time. Anyways code is working fine but ...

© Stack Overflow or respective owner

Related posts about udpclient

Related posts about .NET