When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
6 messages ยท Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
How are you even establishing the connection?
Are you sure write is the correct function? I thought send would be correct.
Also if you want to read an entire line and remove a (possibly) trailing newline character you can do:
fgets(buf, sizeof buf, stdin);
buf[strcspn(buf, "\n")] = 0;
Are you really going through all of creating a socket, binding it, listening to it?
You surely aren't selecting or accepting anything...
This is an example for a simple TCP server + client (one Makefile is for the server, one for the client).
The list.h file is a header only list implementation which I did not code myself.
Here is the source code,so you have the full context. I did establish a connection under the main method.
!solved
Thank you and let us know if you have any more questions!
This thread is now set to auto-hide after an hour of inactivity