Results 1 to 5 of 5

Thread: Winsock Listening???

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Location
    Chicago, IL, USA
    Posts
    9

    Post

    I've got a chat program that I am writing. I have the server listening on port 14000 for a connection. The client connects from 13000. The connection works, however, when you disconnect the client and have the server close the port then listen on port 14000 again, it doesn't allow any connections. Does anyone know why?

    Thanks in advance for your help!

    PS: I'm new to using Winsock.

    ------------------
    If you want to be known, GET ON THE NET!

  2. #2
    Addicted Member Razzle's Avatar
    Join Date
    Jan 2000
    Location
    Berlin, Germany
    Posts
    161

    Post

    have you closed the socket like this:

    If Winsock1.state <> sckClosed Then Winsock1.close

    ?

    ------------------
    Razzle
    ICQ#: 31429438

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Location
    Chicago, IL, USA
    Posts
    9

    Post

    I have already closed the socket and then involked the listen command on the server. Are you talking about the client - because I did close the socket on the client.

    Any other suggestions?

  4. #4
    Member FirePoweR's Avatar
    Join Date
    Apr 1999
    Posts
    32

    Post

    Try setting the localport of the client to 0 before you connect each time.
    If the port is zero when you connect, winsock will assign it a unused port instead of using the same port.

    ------------------
    -FirePoweR-
    [email protected]

    [This message has been edited by FirePoweR (edited 02-07-2000).]

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Location
    Chicago, IL, USA
    Posts
    9

    Post

    So basically your telling me to only assign the remote port and not the local port right? I'll try it!

    Thanks!

    ------------------
    If you want to be known, GET ON THE NET!

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