Send struct over socket in C

后端 未结 2 1384
不知归路
不知归路 2020-12-18 02:22

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:37

    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.

提交回复
热议问题