Resolve a Synergize Process Server SocketException Error When Starting Service

Use this article to resolve the following socket exception error when starting a Synergize Process Server (SPS) process.

ERROR: The process 'SampleProcess' generated an exception. [WebException] Unable to connect to the remote server. [SocketException] Only one usage of each socket address (protocol/network address/port) is normally permitted 192.168.0.1:80

at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)

at System.Net.HttpWebRequest.GetRequestStream()

at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

at Microdea.WebServices.DeploymentWebService.DeploymentMgmt.GetPrimarySynWebLoggingService(String& PrimaryServiceID, String& ServiceURL, String& ErrorMsg)

at Microdea.Synergize.DeploymentManagement.GetLoggingWebService()

at Microdea.Synergize.DeploymentManagement.get_LoggingWebServiceUrl()

at Microdea.ProcessServer.Common.ActionLogging.LogMessage(Activity action, String applicationName, String message, LoggingMessageType logType, String metricName, Double metricValue)

at Microdea.ProcessServer.Common.ActionLogging.LogMessage(Activity action, String message, LoggingMessageType logType)

at Microdea.ProcessServer.Common.ActionLogging.LogError(Activity action, String format, Object[] args)

at Microdea.ProcessServer.Core.BusinessProcess.HandleFault(ActivityExecutionContext executionContext, Exception exception)

at System.Workflow.ComponentModel.ActivityExecutor`1.HandleFault(T activity, ActivityExecutionContext executionContext, Exception exception)

at System.Workflow.ComponentModel.ActivityExecutor`1.HandleFault(Activity activity, ActivityExecutionContext executionContext, Exception exception)

at System.Workflow.ComponentModel.ActivityExecutionFilter.HandleFault(Activity activity, ActivityExecutionContext executionContext, Exception exception)

at System.Workflow.ComponentModel.FaultAndCancellationHandlingFilter.HandleFault(Activity activity, ActivityExecutionContext executionContext, Exception exception)

at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)

at System.Workflow.Runtime.Scheduler.Run()

  1. Review the following details to understand the root cause of this issue before you can make an informed decision about which method you want to use to resolve it:

  1. When the process and applications make authenticated calls, the client is closing connections. When these applications are making authenticated calls repeatedly to the same server, they are making and closing connections repeatedly. The same might happen when making regular http [unauthenticated] calls but setting keep-alive = false.

  2. When a connection is closed, on the side that is closing the connection the 5 tuple
    {Protocol, Local IP, Local Port, Remote IP, Remote Port} goes into a TIME_WAIT state for 240 seconds by default. In this case, the protocol (TCP) is fixed. The local IP, remote IP, and remote PORT are also typically fixed. So, the variable is the local port.

  3. When you don't bind a port in, the range 1024-5000 is used, giving you roughly 4,000 ports. If you make 16 web service calls per second for 4 minutes or 8 web service calls per second for 8 minutes, you will exhaust all the ports. That is the cause of this exception.

  4. This exception typically happens on a server that hosts multiple Synergize applications [SPS, BulkPrint, EMC] and has been observed on Windows 2003/R2 servers.

  1. To resolve the error, choose one of the following methods:

  • Increase the Dynamic Port Range: The max by default is 5000. You can set this up to 65534.

  1. Open RegEdit as Admin and go to:

    HKLM\System\CurrentControlSet\Services\Tcpip\Parameters\MaxUserPort

  2. If MaxUserPort does not exist, create it using the following values:

    DataType - REG_DWORD

    Value - ea60 [hex value for 60000]

  • Reduce the TIME_WAIT setting: Once the connection goes into a TIME_WAIT state, you can reduce the time it is in that state.

    1. The default is 4 minutes (240 seconds).

    2. You can set this to 30 seconds in the following registry key:

      HKLM\System\CurrentControlSet\Services\Tcpip\Parameters\TCPTimedWaitDelay

ORIGINAL SOURCE: (NO LONGER ACTIVE)

http://blogs.msdn.com/b/dgorti/archive/2005/09/18/470766.aspx