Results 1 to 5 of 5

Thread: Winsock states - help needed!

  1. #1

    Thread Starter
    Fanatic Member modpluz's Avatar
    Join Date
    Sep 2005
    Location
    Lag, NG
    Posts
    633

    Winsock states - help needed!

    hi guyz,

    i need somone to help xplain to me all the winsock states

    i only know the sckClosed - 0, sckConnected and sckError but am suprised when i started seein some numerical value like 8

    and i want to know all the winsock states we have what can you actually do with winsock when in this states.


    assuming i entered the wrong server ip from the client app in design time and there's a form i've created where you can specify a new server ip in runtime.

    ok now i run my app and i want to change the ip at runtime and re-connect the winsock. how can i do it

    i've been trying this and it gives error each time saying "wrong protocol or connection state"

    help plz
    Last edited by modpluz; Oct 29th, 2005 at 12:10 PM.
    If you want the rabbit to hop, move the carrot - Paul Kellerman(Prison Break)

    onError GoTo http://vbforums.com



    My Bits:
    VB6: Change Column Name in MS ACCESS

  2. #2
    New Member
    Join Date
    Sep 2005
    Posts
    9

    Re: Winsock states - help needed!

    sckClosed 0 Default. Closed
    sckOpen 1 Open
    sckListening 2 Listening
    sckConnected 7 Connected
    sckError 9 Error

    this is what i found in the msdn library

  3. #3
    New Member
    Join Date
    Sep 2005
    Posts
    9

    Re: Winsock states - help needed!

    and before you can change the ip, or connect it again, try to close it first!

    listen example:
    VB Code:
    1. winsock1.close
    2. winsock1.localport 555
    3. winsock1.listen

    connect example:
    VB Code:
    1. winsock1.close
    2. winsock1.connect "www.microsoft.com", 80

    this should do it... it just have to be closed before you can modify it's settings!

  4. #4

    Thread Starter
    Fanatic Member modpluz's Avatar
    Join Date
    Sep 2005
    Location
    Lag, NG
    Posts
    633

    Re: Winsock states - help needed!

    ok thanks
    If you want the rabbit to hop, move the carrot - Paul Kellerman(Prison Break)

    onError GoTo http://vbforums.com



    My Bits:
    VB6: Change Column Name in MS ACCESS

  5. #5

    Thread Starter
    Fanatic Member modpluz's Avatar
    Join Date
    Sep 2005
    Location
    Lag, NG
    Posts
    633

    Re: Winsock states - help needed!

    but this means you can't use the same port that it's using before it was closed

    it brings up the message "Address is in use"
    Last edited by modpluz; Nov 1st, 2005 at 09:56 PM.
    If you want the rabbit to hop, move the carrot - Paul Kellerman(Prison Break)

    onError GoTo http://vbforums.com



    My Bits:
    VB6: Change Column Name in MS ACCESS

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