Socket errors of 10048 on the client? Possible causes?

Posted by Earlz on Stack Overflow See other posts from Stack Overflow or by Earlz
Published on 2010-03-29T20:15:36Z Indexed on 2010/03/29 20:43 UTC
Read the original article Hit count: 412

Filed under:
|
|
|

Hello, I'm writing a custom TCP server and client and on doing a ton of requests (60,000 to be exact) I begin to get this socket error of 10048, which should mean "the address is already in use."

The error keeps happening unless I pause the process for like 2 or 3 minutes and then begin it again, and then it begins to bring up the same error a short while after restarting it. If I pause the client process and restart the server process, I still get the same error on the client. So it is a complete client side problem.

This does not make sense though, this error only usually occurs when binding and this error happens on the client and not the server. What could be the possible reasons for it?

A small excerpt of my initialization:

TcpClient client = new TcpClient();
client.Connect("XXXXX -- some ip", 25000);
client.NoDelay = true;
NetworkStream clientStream = client.GetStream();

Also, everything else seems to be working fine(including the amount of time it takes to send back and forth) and this works perfectly when using 127.0.0.1 but when putting it on another LAN computer I begin to get the 10048 error.

Is there something wrong with how I initialize it? What else could cause this error on the client side?

© Stack Overflow or respective owner

Related posts about c#

Related posts about sockets