Thursday, February 7, 2008

error 10048 opensta

the 10048 Address already in use errors?
error 10048 opensta
This error occurs when your injector cannot allocate new sockets. On Windows the default limitation is 5000 - 1024 open sockets (5000 is the max user port and the first 1024 ports are reserved).
How can more sockets be made available for OpenSTA's TestExecuter to use?

You can increase the default maximum socket value in the registry:


and add or modify the "MaxUserPort" value.

Another solution, available from OpenSTA 1.4.1 onwards, is to add or modify some parameters in TExecuter_Web.ini configuration file:


Setting the Linger option to 0 (possible values are 0 or 1) means that the sockets will be closed immediately. Normally closed sockets stay in a TIME_WAIT state during the time specified by the "TcpTimedWaitDelay" value in the previously mentioned registry key. Doing this causes a hard disconnect and any unsent data can be lost and can result in some connections resetting on the server end. HTTP servers should be aware of this possibility and should not have problems. Just be aware that if you change this then your connections won't be exactly the same as normal browsing would make and so your results may be affected. The reason to do this is that closed sockets are cleaned immediately and their resources are made available to open new sockets.

Setting the ReuseAddr option to 1 (possible values are 0 or 1) means that (from MSDN docs): "By default, a socket cannot be bound (see bind) to a local address that is already in use. On occasion, however, it can be necessary to reuse an address in this way. Since every connection is uniquely identified by the combination of local and remote addresses, there is no problem with having two sockets bound to the same local address as long as the remote addresses are different. To inform the Windows Sockets provider that a bind on a socket should not be disallowed because the desired address is already in use by another socket, the application should set the SO_REUSEADDR socket option for the socket before issuing the bind."

No comments: