Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything 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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi all,
I'm working on testing some software, and I have a question. We have several files of binary data that we need to push through our application to test. It communicates via simple TCP sockets. Is there a way I can send this data to the socket from the command line? I tried doing something like this, but telnet never picked up the data.
Thanks for the help, but I'm getting some wierd errors. My test message is only 28 bytes in length, but when my program receives it I have as 8192 bytes on the buffer coming from the sender. I've tried both
Code:
cat test.sbd |nc localhost 8080
and
Code:
nc localhost 8080 < test.sbd
I've noticed that it sends the data, but it doesn't disconnect from the socket after the data is sent. Is there a param I'm missing? I couldn't find anything in the man pages but I need to set the socket buffer length to match the number of bytes in the message. I know this isn't a bug in the receiver given that the production system only transmits the size of the input file then closes the socket, and the receiver has the correct buffer length.
Without knowing anything about the application you're testing, I am not sure what to suggest on that front. To troubleshoot further, you may want to capture the packets and see what is going on with the tcp conversation.
Well, both solutions work for pushing data through a socket. However I'm still experiencing the issues of an invalid length. I'm actually running OS X 10.5, so it must be an issue with it's network sockets. I've tried both cat and dd to dump the bytes onto the pipe for the network calls, but it doesn't seem to help the issue. It looks like I'm going to have to write something that disconnects after sending the bytes in the file.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.