Results 1 to 18 of 18

Thread: Winsock 10048 error [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2004
    Posts
    53

    Resolved Winsock 10048 error [RESOLVED]

    Hi All,

    [RESOLVED: Problem was that I had another winsock control already listening on the same port numbers! Silly me!]

    Firstly I apologise for the long post. I just need to get this sorted. I've been searching all night and can't seem to find an answer. I have a winsock control array on my server form, and a winsock control on my client form.

    Ive written a procedure to gather all the data so i don't miss anything coming through the GetData buffer, and all seems to work well I can get data from A-B without loss, and reliably.

    Until I close my client, and attempt to open and reconnect (very important to be able to do this quickly) My searching keeps bringing me back here -> http://support.microsoft.com/kb/q173619/

    my code is lengthy, with all sort of junk in between, but the general settings are:

    server: sckServ
    .RemotePort = 4411
    .LocalPort = 4511
    .Listen

    client: sckClient
    .RemotePort = 4511
    .LocalPort = 0
    .Connect

    this all works fine and is no problems except for when I try to reconnect I get the dreaded address in use error. MS tells me to set localport as 0.. so I change my sckServ.LocalPort to 0, no longer connects my client throws a state of '6' then shortly after switches to state '9'.. i.e doesn't connect at all. Admittably the error is no longer there.. but my app is not very usable.

    I understand the workings of the TCP stack enough to know it will keep a port mapped to an app, unless its closed properly. I'm using the standard .Close method of the winsock control.. should this supplemented with anything else?

    Bear in mind that at the moment this is only dealing with one of the sckServ in an array (i haven't got far enough to try that out yet), and I want to use a specific port-set so I can configure port forwding on my router and use this app from work.

    A couple of suggestions that I have tried include:
    http://www.vbforums.com/showthread.p...=10048+winsock

    http://www.vbforums.com/showthread.p...=10048+winsock <- the API I haven't tried but i am in the process of working through it with a sample app im making specifically for this error. If anyone has tried that I'd love to know how you got on with it.


    Thanks in advance for any replies, advice, suggestions etc.. I'm really stumped on this one.

    Tim.
    Last edited by emtark; May 8th, 2008 at 06:45 AM.
    Tim.

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