• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 223
  • Last Modified:

visual c++ socket programming

Hi,

I'm new to socket programming as well as visual c++....I would like to create a simple client socket on windows that will connect to a server socket running on Linux. I've been reading the web, and am now confused between winsock and CAsyncSocket.

Can anyone help me on how I should get started? Which should I use? Any sample codes on very simple client/server connection? Maybe echo back a simple line of text?

thanx!
0
jade03
Asked:
jade03
  • 4
  • 3
1 Solution
 
Svetlin_PanayotovCommented:
CAsyncSocket is basically a wrapper for winsock.CSocket or CAsyncSocket are also MFC classes.For sample code - check this:
http://www.codeproject.com/internet/#Beginners
and http://www.codeproject.com/internet/#Client%2FServer+Development
0
 
jade03Author Commented:
So, if I have a server, then a client connected to the server, then a GUI that will connect to the client, is it considered peer-to-peer between the GUI and the client? And will the connection code be similar to a normal client and server code?
0
 
Svetlin_PanayotovCommented:
Well it's better to look at the client and the GUI as a whole thing - but if you prefer it this way - yes - the code that connects the GUI and the client is "kind of" p2p.But if I got your question right - the client and the GUI are on the same machine - so they can communicate with windows messages, events, callbacks etc.

Svetlin
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
jade03Author Commented:
actually, I won't be implementing the client myself, but I think it will be running on Linux, and the GUI will be running on windows. So, can I still connect to the client using regular client/server socket connection?
0
 
Svetlin_PanayotovCommented:
Yes - you should be able to.
0
 
jade03Author Commented:
Thanx for all the tips, Svetlin! :)
0
 
Svetlin_PanayotovCommented:
You're welcome :)
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now