Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 265
  • Last Modified:

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
0
lmh99
Asked:
lmh99
1 Solution
 
jhanceCommented:
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)
0
 
lmh99Author Commented:
I need some sample source codes of server and client.
Thanks.
0
 
Tommy HuiCommented:
Take a look at the samples ChatSrvr (server) and Chatter (client) in \vc\samples\mfc\advanced on your CD or harddisk in Visual C++.
0
 
lmh99Author Commented:
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.
0
 
santoroaCommented:
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

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