Results 1 to 4 of 4

Thread: TCP-connection remains in State "Connecting"

  1. #1

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Resolved TCP-connection remains in State "Connecting"

    Hi,I'm ran into a problem with my LAN-application.
    I'm connecting six applications over a LAN and for testing on one PC (using the loopbackIP). I have that running, but (out of a sudden?) I'm uable to connect a special type of the clients. Since all types are using the same code (server and clients are in the same EXE, identified by selectable type), and all are connecting good I'm a bit lost.

    The Server is listening on a WinsockArray (indexNumber 0), LocalPort set 1360.
    The Client is connecting to that port on an automaticly selceted socketHandle (setting 0).
    The server does get the _ConnectionRequest on ArrayItem 0 (the SocketHandle is different from the Client-one, but that should be OK). The LocalPort and RemotePort-Settings are ViceVersa to the Client. In this event the server .Accepts the connection on a new ArrayItem (it won't work wether I try the problem client first last or any point in between, and I tried it after reboot as well). The state of the connection on the server side is now "connected".
    The next thing i'd be looking forward would be the _Connect Event on the client side, but that doesn't happen! The state on the Clinet remains "connecting".

    The only difference I could figure out between a connecting client and the problem one is that the problem client doesn't show the .RemoteHostIP.
    The .RemoteHost is set by the code to "127.0.0.1" before connecting, for a good client the same value would show for .RemoteHostIP, but for he problem client this value remains empty.

    Does anybody have an idea wherelese I could look!
    Last edited by opus; Mar 13th, 2007 at 10:17 AM.
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  2. #2
    Hyperactive Member
    Join Date
    Oct 2006
    Posts
    354

    Re: TCP-connection remains in State "Connecting"

    two things:

    you will get "connecting" if your ACL on your router / switch is enabled and filtering you. However, you connect, so you ACL might have a connection limit.

    The possibility is you are hitting the connection limit of XP. Try running it on 2003.


    {edit}
    I just re-read your post. disregard the first thing. If it maps directly to 127.0.0.1, it shouldn't leave your network card, and it should just go through the loopback. however, hard coding it to the machine actually ip would leave your network card and come back.

  3. #3

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Re: TCP-connection remains in State "Connecting"

    Weird,
    after having the Laptop been shutdown over night, the problem Clinet did get connected???? But only once, closing and than starting the the client again gave the "old" faulty result. I'm lost!
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  4. #4

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Re: TCP-connection remains in State "Connecting"

    FOUND the problem!
    Instead of having just:
    Code:
    WinsockTCP(0).Connect ServerIp, ServerPort
    the following solved the problem.
    Code:
    Connected=False
    WinsockTCP(0).Connect ServerIp, ServerPort
    Do
       DoEvents
    Loop Until Connected=True
    With this line added in the winsockTCP_Connect Event
    Code:
    Connected=True
    Maybe al the problems I had, with clients not connecting "sometimes" (I even posted other threads in this ) could be solved by this one.
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

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