|
Harakim: i think your problem is with checking the error condition.. for example with send.. it returns the length of the string your sending..
for example if you send the string "Hello" which is of size 5.
then if (send == 5) no error occurs... else an error occured..
im not very sure about the recieving case.. but the recieve function should return one of 2 values.. returns 0 if error occured and -1 when there was no error.. so if (recieve == -1) no error.. else an error occured..
Alright i have a question on sockets.. lets say i want to listen on a socket.. or wait for data to be sent.. and at the same time run some code.. i want to print numbers 1 to infinity . i.e keep incrementing and print..and then when i recieve a message on the socket. the function halts and some other operation is executed..
|