I have a question on sockets. I have this code:
while(bytes = recv(sClient, cClientMessage, 599, 0)){
This puts the message it recives into cClientMessage and the message is always ‘Message’. How I made an if statement like if(cClientMessage == 'Message'){//do func}. Now this code will not do the function I want. I think this is because it’s not receiving the message right. Can someone help me?
Try:
Edit, following suggestion from strager:
A better solution, which does not depend on the received data being null terminated is to use memcmp: