Results 1 to 5 of 5

Thread: [RESOLVED] Getting 'Address In Use' Run-time Error, Now!!

  1. #1

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,910

    Resolved [RESOLVED] Getting 'Address In Use' Run-time Error, Now!!

    When I try to run my code through "Command10", on the Form. I get a run-time error and the code is: '10048' and the description of it, is 'Address In Use'. That is crashing the program as well.

    Can someone help me.
    Last edited by ThEiMp; Jun 27th, 2009 at 09:41 PM.
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Event's Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Bar | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  2. #2
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Getting 'Address In Use' Run-time Error, Now!!

    The error is caused because you are trying to address a socket that is currently in use either by your application or some other application.

    Example of another application

    A program is running with a socket connected to some URL on let's say port 555 and you start up another program that tries to connect to even a different URL but the port number is also 555.

    Ummm, wonder why it isn't called 'Port Number In Use'

    Also, even if you close your application but you did not close your socket and you try to use that same socket address again you will get this error
    Last edited by jmsrickland; Feb 22nd, 2009 at 12:18 AM.

  3. #3
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Getting 'Address In Use' Run-time Error, Now!!

    Straight from MSDN: Typically, only one usage of each socket address (protocol/IP address/port) is permitted. This error occurs if an application attempts to bind a socket to an IP address/port that has already been used for an existing socket, or a socket that was not closed properly, or one that is still in the process of closing. For server applications that need to bind multiple sockets to the same port number, consider using setsockopt (SO_REUSEADDR). Client applications usually need not call bind at all—connect chooses an unused port automatically. When bind is called with a wildcard address (involving ADDR_ANY), a WSAEADDRINUSE error could be delayed until the specific address is committed. This could happen with a call to another function later, including connect, listen, WSAConnect, or WSAJoinLeaf.
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  4. #4

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,910

    Re: Getting 'Address In Use' Run-time Error, Now!!

    So how do I close a socket, that was being used by my project?
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Event's Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Bar | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  5. #5
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Getting 'Address In Use' Run-time Error, Now!!

    Winsock1.Close

    You should close your socket in your Winsock1_Close event and/or when you Exit out of your application

    Basiclly you should have

    1) Command button for manualy closing of socket
    2) Winsock_Close event in case other side disconnects from you
    3) Form_Unload event when you shut down your application

    To avoid run-time error use an If...Then clause

    If Winsock1.State = sckConnect(ed) Then Winsock1.Close
    Last edited by jmsrickland; Feb 22nd, 2009 at 08:24 AM.

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