Send struct over socket in C

后端 未结 2 1376
迷失自我
迷失自我 2020-12-18 02:02

I am developing a client/server program and my client has to send messages to the server.

Sample message C structure:

struct Reg         


        
2条回答
  •  情深已故
    2020-12-18 02:46

    While the code will work if you send and recv on the same endian machine - your client and server should ideally perform a host to network endian conversion to maintain coherence when inspecting clientPid.

提交回复
热议问题