Click here to Skip to main content
15,896,269 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do i send and receive multiple fields of a record in server and client application with C++ winsock.
Posted

1 solution

The same way you send and receive anything. You just need your client and server to understand the format of the data that you are transferring. If it is fixed length records than that is easy. If it is variable length then you just need to include extra information to show the length of the data.
 
Share this answer
 
Comments
Tonex247 22-Aug-14 12:15pm    
I dont think its that simple. So if you are sending Name, Address, as string, and Amount as integer in one record, you just pack them together? I know it should have something to do with objects of a class
Richard MacCutchan 22-Aug-14 12:42pm    
Yes but an object has no meaning in network transfer, all you are sending is a stream of bytes, some of those bytes will represent strings, some will represent integers, some will represent DateTime values etc. The only issue is that the client and server both agree on the structure of the data.
Tonex247 22-Aug-14 13:53pm    
@Richard thanks, I have heard of some object serialization, maybe i should look into it. it should be easier. Thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900