Hi,
I was also working to create a Client Server Application. But I'm getting connection error after sometimes. (No regularity)
Here is the sample code from TCP/IP V-3 by R.Stevens
Printable View
Hi,
I was also working to create a Client Server Application. But I'm getting connection error after sometimes. (No regularity)
Here is the sample code from TCP/IP V-3 by R.Stevens
>>But I'm getting connection error after sometimes
Can you be more specific? Post your troublesome code here rather than linking to code from a book.
Okay .. at least a response from one. Thank you for that.
That's modified code which I'm working with.
I was testing what happen when client is trying to send data and server is not running.
In that situation, when I start the server, some times it works(receive data), some times not.
Note: Original code does not contain
#define MSG_EOF 0x100 but used. Is there any problem with that?
>>#define MSG_EOF 0x100 but used. Is there any problem with that?
It depends what you're doing with it. Where are you using it in the code?
Anyway, if you're putting it in the data as a trailing byte to denote EOF, it won't work as it is > 255, and therefore won't fit in one byte.