Everything is in the title, i'm on linux, I have a socket client and a socker server program in C and I'd like to test my server with Telnet but I can't seem to find how, do you have any idea ?
Thanks in advance
Let's say your server is accepting incoming TCP connections on port 9999.
You can then open up a shell window (on the same machine your server is running on) and enter:
telnet localhost 9999
... and (if all is working as expected), telnet will connect to your server. (if telnet errors out instead with "connection refused", that means no server is accepting TCP connections on that port)
You can then type ASCII characters into the telnet window, and when you press return, those ASCII characters will be sent to your server; and any output the server writes to its end of the socket will show up in your telnet window.
The caveat is that telnet only works well as a test mechanism if your server is expecting to send/receive ASCII data; if OTOH your server is sending binary data, that will appear in the telnet window as strange-looking garbage characters, and also there's no easy way to enter arbitrary binary data into a telnet window to send it to your server.