Results 1 to 3 of 3

Thread: Yell if you have used WINSOCK

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    461

    Exclamation

    I am after anyone who has used Winsock before.

    I have have 3 applications :

    1. Standalone Exe for the client machine
    2. Exe that runs as an NT Service on the server
    3. Standalone Exe for the server machine

    App 2 when the service starts kicks off App 3 and connects via WinSock to be able to "remote control" it.

    App 1 connects via WinSock to App2 allowing you to remote control App 3 using App 2 as a buffer. It is done this way so that if App 3 freezes, App 2 can forcefully close it down, kick it off again and re-establish a connection.

    Anyone had any problems with using WinSock and any "pitfalls" I should know about?

    At the moment I am getting an 10049 "Address is not available from the local machine" but I cannot find any documentation which states the range allowable for the port number. I set the Local port number to 0 so it will automatically choose its own.

    Suggestions?

  2. #2
    Addicted Member
    Join Date
    Jul 1999
    Location
    St-Élie d'Orford, Quebec, Canada
    Posts
    133
    Hi,

    I've designed an app that uses Winsocks and I can tell you
    a couple things about "pitfalls"

    1) Always watch the connection state before sending any data through the port. If you send something through a closed connection port you will be promped with a "Wrong protocol or state for connection" error.

    2) Use the Error Event of the winsock to be sure when the client closes the connection on it's side with events like CTRL+ALT+DEL or OFF or RESET... In these cases if I remember well, the close event is not generated !!! (test it)

    3) RemotePort : Port number used (never valid) are listed in the "Service" file in your "Windows" directory. I'am not sure but I think the standard for choosing a port is anything under 1024 is for internet connections, the rest you pick one and hope it's not already used on the PC !!!

    The rest, you will soon discover the joys of "winsock programming" or as I prefer calling this "WinSUCKS programming"...





  3. #3
    Hyperactive Member
    Join Date
    May 2000
    Posts
    367
    This will be a challenge.

    Winsock has all kinds of peculiarities.

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