Server write error #282
-
|
제가 작성한 write 코드가 왜 제대로 실행되지 않는지 모르겠어서 3번째 테스트 케이스인 Server -> Client 부터 디버깅을 하고 있는데, 아예 server 측에서 write 함수가 제대로 작동하지 않습니다.
total_size가 0보다 크다면 제가 작성한 read 함수가 ack을 제대로 보내지 않는 등의 문제일 수도 있겠는데, 한 번도 실행되지 않고 바로 Invalid argument 에러가 발생하는 것은 제가 코드를 바꾼다고 해결할 수 있는 문제가 아니지 않나요? 혹시 기존 코드에 문제가 있는지, 아니면 제 코드(client)의 어떤 부분이 서버의 write 코드의 실행에 영향을 끼쳐 이런 에러를 일으킬 수 있는지 궁금합니다. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Beta Was this translation helpful? Give feedback.
-
|
Could you specify your question as If you got an error on the recv side, then your error is not related to the part attached to your first question, but it would be related to int remaining = buffer_size; As you could see, this is related to the read system call. From my test code, the 189th line is a comment line, so I guess your error originates from the 177th line, where the difference between the size that is read (or written) is different from the value expected. Trying to debug yourself with the printf function in your actual code might help you understand which test case tests which system calls. |
Beta Was this translation helpful? Give feedback.
-
|
I got a little confusion here. Did you give your ack = syn + 1 in your handshake or in communication? Try to check the pcap when you run the model solution. I think this might help. |
Beta Was this translation helpful? Give feedback.

I got a little confusion here. Did you give your ack = syn + 1 in your handshake or in communication? Try to check the pcap when you run the model solution. I think this might help.