Results 1 to 5 of 5

Thread: [RESOLVED] Problem with Portnumber 55001

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2016
    Location
    Perth Australia
    Posts
    55

    Resolved [RESOLVED] Problem with Portnumber 55001

    I have been using PortNumber 55001 flawlessly for years and today this will not run on my Windows 10 PC (same machine I have been using for years). This is part of a server setup using TCP to service clients on a private local network. My PC will now crash on the indicated line using portNumber = 55001.

    My code:



    Code:
    'create a new listener instance bound to the desired address and port
      listener = New TcpListener(IPAddress.Any, portNumber)
      'start the listener
      listener.Start()     '<======== CRASHES HERE 
     'begin accepting clients until the listener is closed
    The very same code is still working fine on my Windows surface laptop ... without any trouble.
    What could have caused this to no longer work ?

    The ERROR message generated is:

    Code:
    System.Net.Sockets.SocketException
      HResult=0x80004005
      Message=Only one usage of each socket address (protocol/network address/port) is normally permitted
      Source=System
      StackTrace:
       at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
       at System.Net.Sockets.Socket.Bind(EndPoint localEP)
       at System.Net.Sockets.TcpListener.Start(Int32 backlog)
       at System.Net.Sockets.TcpListener.Start()
       at MRCTcpServerApp.frmControlPanel.VB$StateMachine_169_startButton_Click.MoveNext() in C:\Users\Montgomery\Desktop\MRC Files\Visual Basic Files\VisualStudio Files\intersSWIM Server\MRCTcpServerApp\Form2.vb:line 114
    
      This exception was originally thrown at this call stack:
        [External Code]
        MRCTcpServerApp.frmControlPanel.startButton_Click(Object, System.EventArgs) in Form2.vb

    Any ideas what has gone wrong and how to fix it ??? .... I know the code is perfectly fine since it has worked for years (and still works on my laptop). I am using VS 2019 with version 16.8.3.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,297

    Re: Problem with Portnumber 55001

    Did you bother to read the error message?
    Only one usage of each socket address (protocol/network address/port) is normally permitted
    What do you suppose that means? If it's telling you that only one usage of a port is allowed then you must be trying to make more than one usage, i.e. some other app is already using that port. That could be another instance of your app but is likely some other app that has recently been installed or updated.

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2016
    Location
    Perth Australia
    Posts
    55

    Re: Problem with Portnumber 55001

    Quote Originally Posted by jmcilhinney View Post
    Did you bother to read the error message?

    What do you suppose that means? If it's telling you that only one usage of a port is allowed then you must be trying to make more than one usage, i.e. some other app is already using that port. That could be another instance of your app but is likely some other app that has recently been installed or updated.
    Yes understood .... I know of no other app that has been recently installed or updated that could be interfering with this.

  4. #4

    Thread Starter
    Member
    Join Date
    Jun 2016
    Location
    Perth Australia
    Posts
    55

    Re: Problem with Portnumber 55001

    ok .... this is weird .... now it is working without any trouble !!! Bizarre since I did do a restart as part of my fault finding. I will say it is cured now ... don't know though what it was !!!!

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,297

    Re: [RESOLVED] Problem with Portnumber 55001

    It was likely a previous instance of your app that didn't release the post correctly. If you had an app crash recently then that's probably it. Otherwise, you may never know the specific issue. These things happen from time to time.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width