Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8034187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:55:53+00:00 2026-06-05T01:55:53+00:00

I have a service which as it’s coming up invokes the Start() method on

  • 0

I have a service which as it’s coming up invokes the Start() method on a TcpListener instance. This listener is using a port that is not common and not known to be used by any other services. Very very rarely for a span of minute or so it experiences an odd error. For a minute the service (which on failure restarts immediately) back to back crashes on the following exception:

   SocketException
   at System.Net.Sockets.Socket.DoBind(System.Net.EndPoint, System.Net.SocketAddress)
   at System.Net.Sockets.Socket.Bind(System.Net.EndPoint)
   at System.Net.Sockets.TcpListener.Start(Int32)
   at MyTestServer.Server.StartListening()

With exception message as follows:

Only one usage of each socket address (protocol/network address/port) is normally permitted

This article suggests that I’m experience port exhaustion and that I should tweak the registry to modify timeout and port range values for WinSock. This is all good and well, but I only have (or expect to have) 50-100 clients connecting. How could I possibly run out of ports? Bots and port scanners?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:55:55+00:00Added an answer on June 5, 2026 at 1:55 am

    It probably isn’t port exhaustion as it was in that post. They were connecting out with WCF (which would be like the TCPClient). You are binding to a TCP Port and waiting for the connection. It isn’t strictly the same thing. You are binding to a specific TCP Port number. When you get this message, windows (correctly or not) thinks that it is in use. Windows is reporting that another process is already bound to that port, so you can’t. You can have 2 processes trying to use the port and get this problem, so the 50-100 figure isn’t the issue.

    Either you are causing this problem somewhere else or there is some other application that is causing this problem.

    If the service is experiencing a problem and dies without ever calling TCPListener.Stop(), then the service restarts itself, it won’t be able to bind to the port because windows may not know the process is done with it.

    You’ll have to post more details to get into it any further.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a service which has a method that downloads an image from an
I have a service which runs every 1 minute through an alarm manager. This
I have a service which I am writing that is intended to be used
I have a service which has one endpoint , I have defined this endpoint
I have a service which creates a number of child processes. Using c# I
I have a windows service which will start and stop the execution of some
I have a service which is binded to application context like this: getApplicationContext().bindService( new
I have a service which communicates through tcpListener. Problem is when the user restarts
I have a Service which is playing music. I've implemented fade out like this
I have a service which listens for incoming connections on a TCP\IP port number

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.