BeginToLearn
asked on
receiving -server
ASKER
ubuntu@ubuntu:~/program$ ./server
received wrong size_to_read: Transport endpoint is not connected
ubuntu@ubuntu:~/program$
I am drawing picture how clients work and reviewing with server to make sure server match with client.
received wrong size_to_read: Transport endpoint is not connected
ubuntu@ubuntu:~/program$
I am drawing picture how clients work and reviewing with server to make sure server match with client.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
oh i am rearrage my functions to make it similar to the flow of client.c now :) give me 1 hour to complete it first. tks :)
please take a look at client.c
please take a look at client.c
>> please take a look at client.c
Why ?
The error you are having, is because you are passing the wrong socket to the receiveMessage function. If you fix that, it should work better. No need for re-arranging code ;)
Why ?
The error you are having, is because you are passing the wrong socket to the receiveMessage function. If you fix that, it should work better. No need for re-arranging code ;)
ASKER
I fixed that error already. I must use "newsockfd" instead of "sockfd". The reason i rearrage my code is to make it t coherent to client.c . So it will make more sense and less prone-error, easier to debug hihi
Ok. That's fine.
But if your problem has been fixed, there seems to be no reason to keep this question open any more ...
But if your problem has been fixed, there seems to be no reason to keep this question open any more ...
ASKER
hold on a little bit
ASKER
on Server.c from line 115 to 126, how can know it finishes reading all trunk of the file? do I check the return of receiveMessage() to determine it? tks.
server.c
server.c
Ok, but this is not related to your original problem :
>> received wrong size_to_read: Transport endpoint is not connected
so it should really go in a new question.
>> received wrong size_to_read: Transport endpoint is not connected
so it should really go in a new question.
one hint: the message 2 gives filesize.
i'll elaborate more in your next question.
Sara
(please don't give points for this hint. you got the answer to your q. already).
i'll elaborate more in your next question.
Sara
(please don't give points for this hint. you got the answer to your q. already).
What error would that be ?
Do you get an error message ? If so, can you copy-paste it here literally ?
Does the code misbehave ? If so can you explain how it misbehaves ? (ie. what do you expect to happen, but what is happening instead)