Link to home
Start Free TrialLog in
Avatar of lmh99
lmh99

asked on

Socket programming with VC++5.0

I want to make a client-server communication simulator on PC.
I'm wondering what is the best structure for it.
Using Serialize? Or just socket function?
Please let me know the best structure for my program.
And I hope to get the simple example code about it.
On my communication simulator, various data sizes and forms are used.
Thanks
Avatar of jhance
jhance

You're talking about two different things here.  

Serialization is the process where objects prepare themselves to be sent somewhere serially.  It may be just to a disk file for later retrieval but may also be to be sent over a network link.

Sockets are just one of the ways a Windows program might choose to communicate with another program either locally or on a remote system.  WINSOCK would be the lowest level of TCP/IP communications programming on a Windows platform.  This would probably work best if you need a lot of control of what's going on.  The drawback is that there are a lot of details to manage.  MFC provides some higher level classes to handle network connections CSocket and it's relatives are useful.  Microsoft also provides some COM objects that provide even higher levels of abstraction and functionality.  

At this point, I'd recommend you get a good book on the basics of Windows network programming.  A good starting place is "Programming Winsock" by Arthur Dumas (SAMS Publishing)
Avatar of lmh99

ASKER

I need some sample source codes of server and client.
Thanks.
Take a look at the samples ChatSrvr (server) and Chatter (client) in \vc\samples\mfc\advanced on your CD or harddisk in Visual C++.
Avatar of lmh99

ASKER

I have VC++5.0 sample code.
What I need is simpler one.
I want to understand the structure of socket communication
so I need a code that can describe the structure of it briefly.
Thanks.
ASKER CERTIFIED SOLUTION
Avatar of santoroa
santoroa

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial