Hello everyone.

Working with winsock, I have successfully been able to connect a client application to a server application that is running on the SAME computer.

My problem is, I cannot, for the life of me, get a client application to "connect" to a server application that is running on a seperate computer from that which the client application is running on.

Please note: I do NOT want to use LAN to be able to connect a client to a server running on different pcs, but rather, would like to connect to another pc running the server app over the internet.

Is there ANYONE who is able to tell me just how I would go about connecting a client to a server that is running on another pc?

Your help will be greatly appreciated.

Did you try MSDN? They pretty much have everything related to Winsock programming. Also this website seems to be quite useful on explaining what you need to establish a connection.

MSDN shows how to connect a client app to a server app on the same pc. There is, however, no examples on how to connect a client to a server that dwells on a diff. pc.

MSDN makes use of IN_ADDRANY, but does not provide examples on how inet_addr() could be used to connect a client to a remote server app. Thanks for your reply.

There is no difference, except that you connect to the remote IP address instead of your own.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.