[java] Writing to Socket ?
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.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement