Correctly send packed structure through network
I've a problem I can't solve so I hope someone can help me here.
The original error is here :
https://gist.github.com/Tuxity/9649ed1c2142f78bd076 a simple segmentation
fault. But why ? because the server try to handle a packet it wasn't
suppose to receive : SMSG_WHO_IS_HERE.
The thing is I never send this opcode with my test client so I guess it's
a rest of the previous packet I send to the server : CMSG_ME.
So I think my problem is around my packet structure and the way I
send/receive it, bad packing (I heard about #pragma pack()) or whatever.
You can find all my code here :
https://github.com/pixl-project/RetroArch/tree/master/smart-server
The main part of the server is in netServer.c, the packet structure in
netPackets.h, the client I use for test in test/client.c
Thx in advance for any advice, help, idea you can give me.
No comments:
Post a Comment