Exception on send with UDPClient

P

pavel.orehov

Hi,

I am using UDPClient with C# to communicate with other peer.

I have the problem that when I send a lot of data to the remote peer I
get an error "An operation was attempted on something that is not a
socket". From the beginning everything works fine, I receive and send
data, but after several seconds of communication I get this error. I
send and receive data with a speed of 100 msec average.

I start the client:

mUdpClient = new UdpClient();
mUdpClient.Client.Bind(theIPEndPoint);

And I send:

mUdpClient.Send(pData, pData.Length, mRemoteIPEndPoint);

When the error occurs the "mRemoteIPEndPoint" is okey but the
mUdpClient members seems to be dead.

Thanks,
Pavel
 
P

pavel.orehov

Well, it was probably because of send timeout, since when I switched to
BeginSend it started to work fine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top