atom feed4 messages in com.perforce.perforce-userRe: [p4] WSAEADDRINUSE error
FromSent OnAttachments
b kumarOct 7, 2008 9:37 am 
Frank CompagnerOct 7, 2008 2:03 pm 
b kumarOct 7, 2008 3:39 pm 
McKenna, RobertOct 7, 2008 3:58 pm 
Subject:Re: [p4] WSAEADDRINUSE error
From:McKenna, Robert (
Date:Oct 7, 2008 3:58:02 pm

One of our users had this problem which was resolved with supports help. Here is an excerpt from supports suggestion.

In any event, depending on the Windows version the user is running, he can try the method described in the following Microsoft KB article:


. Start Registry Editor (Regedt32.exe). . Locate the MaxUserPort key in the registry:


. On the Edit menu, click Add Value, and then add the following registry value:

Value Name: MaxUserPort Data Type: REG_DWORD Value: 65534 (for example) Valid Range: 5000-65534 (decimal) Default: 0x1388 (5000 decimal)

. Locate the TcpTimedWaitDelay key in the registry:


. Change it to some much smaller number (like 20 or 50):


Key: Tcpip\Parameters Value Type: REG_DWORD-time in seconds Valid Range: 30-300 (decimal) Default: 0xF0 (240 decimal)

I'm assuming that you are running the script on windows.

Rob McKenna

-----Original Message----- From: [] On Behalf Of b kumar Sent: Tuesday, October 07, 2008 4:40 PM To: Frank Compagner Cc: Subject: Re: [p4] WSAEADDRINUSE error

Yes the script uses p4 command line to connect to the server, i will try out your suggestion and convert it to use p4 api

Date: Tue, 7 Oct 2008 23:03:56 +0200 From: To: CC: Subject: Re: [p4] WSAEADDRINUSE error

Could it be that it is your script itself that is causing the error? Is the script using the p4 commandline to connect to the server? How many p4 commands do you run? If you use the p4 commandline a new connection to the server is established for every command you run, and, if I recall correctly, these are kept alive on the server side for some time after the client is finished. So if you run a lot of commands in quick succession you can run out of ports on the server.

If you're using Perl, Ruby or Python, you could build your script on the scripting api's. They will allow you to use a single connection for any number of commands. For details, see:

---------------------------------------------------------------- Frank Compagner Guerrilla Games

bk> Hi bk> i have a script that gets run at the end of the day to bk> recursively check through all the changes that was submitted bk> during the day, to see if the files that are part of the bk> changelist follow a certain format. Whenever the changelist has a bk> lot of files say 50,000 + i get WSAEADDRINUSE error. bk> Connect to server failed; check $P4PORT. bk> TCP connect to perforceserver:1666 failed. bk> connect: perforceserver:1666: WSAEADDRINUSE bk> At the time of the error, only the script is trying to access bk> perforce, I was wondering if there is way to find out the bk> offending program or operation that is trying the use that port bk> that perforce script is trying to use.

bk> Thanks bk> Bala

bk> _________________________________________________________________ bk> See how Windows Mobile brings your life together-at home, work, or on the go. bk> bk> _______________________________________________ bk> perforce-user mailing list - bk>

_________________________________________________________________ Stay up to date on your PC, the Web, and your mobile phone with Windows Live.