ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I wrote an app that uses sockets. It recv's strings, and depending on the string, it performs an action. Ill eventually write a client to send the strings, but id like to test it right now. I thought i could do this with telnet, but couldnt figure it out. Is there some program that will let me connect to my server and send strings? Or will telnet do this?
Yes telnet will work fine for that:
telnet hostname portnumber
The hostname can usually be localhost, and the portnumber is the number you told your server to listen on.
Just another thing. The above is only true if you are using stream sockets (TCP/IP) in your application. If you are using datagram (UDP/IP) or other type of sockets then it won't work with telnet.
Well if you are getting errors then there must be something wrong with your program then. Once you are connected with telnet everything you type will get sent directly to the server side.
Don't need to type any specific commands.
Well, telnet is perfect for this situation, mainly if your server app receive strings, because telnet faithfully sends each byte you type to server and show each byte received from server on screen.
Rather than, if your app expect a especific format of commands, telnet maybe no work properly, because you will have dificulty to type binary data.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.