hello, im already messing around with a winsock tutorial i found on rohitab.com. on the server side i want to catch the incoming strings (which the client sends) and do an "if/then", so IF the client sends a certain string THEN i can call another funtion at server side. but i cant find the variable which holds the incoming string! so i dont know which variable i have to check! can you please help me? thanks so much... sorry its a bit much code...
I assume you are using recv(), in that case the string will be in the buffer you sent as an argument to recv:
ssize_t recv(int s, void *buf, size_t len, int flags);
Here buf is where your message is stored. Be warned: just because your client sent "Hello world", doesn't mean the receiver will receive the whole message! It could only receive "Hello w" in which case you would need to loop and call recv() again and put the message together. To solve this problem, your sender should attach the size of the message to the start so the receiver knows how many characters follow. All this stuff is covered in the guide though.