problem in sending array of structures in client/server program
i am writing a client server program wherein i have to send multiple records containing many fields. when i send from client to server only 1st record is being print not the second. wat can i do in this case?
|
How are you sending the records? Describe how you're writing the data to the socket connection.
|
send them as a struct.. im assuming your using C
|
i am sending records in a structure.... there r fields defined in the structure... one structure is being sent but not the second and the rest...
|
You're doing a direct write/send of the memory block of the structure? That is bad form for network communications. This is not portable and only works when the client/sender and server/receiver are running on identical architectures.
For better portability between systems a simple thing to do is marshal all your structure elements into a text string. Delimiters between fields help with parsing, and some kind of start/end sentinel values will help the code know when it has received a complete string. |
r u using IPC or socket programming
|
All times are GMT -5. The time now is 04:33 PM. |