• Advertisement
Sign in to follow this  

[java] Writing to Socket ?

This topic is 4728 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys, I'm using Ethereal to look at the packets I'm sending out. I want to send the exact same packet using my own socket. I created the socket just fine but what should I use to send it ? In the Java examples they use a PrintWriter but I can't get it to work. Do I have to send everything that I see in Ethereal or is the top part the header that Java will automatically include ? The packet in Ethereal looks something like this (ASCII view): ..stuff not ascii......<xml stuff>. Any help would be appreciated. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Hi.

You can use most streams that can be constructed over the basic OutputStream
(which you can get from clientSocket.getOutputStream()).

As for ethereal, you only need to send the parts of the packet under the "data" section.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement