Quote:
Originally Posted by princeofpain
Hi, I'm trying to write a proxy in Java (for educational purposes and personal use) and I was having some problems sending C5 48 69 12 B3 D5 C2 8A to the client, it would simply close every time I write to the socket using
Code:
sendC=soc.getOutputStream();
sendC.write(byte1);
What is the correct way to write packets to the socket? Any links or advice would be much appreciated.
|
The OutputStream#write method would be the correct way to write data to the socket, and your code looks like it's doing exactly that, but I can't tell for sure with just those two lines.
AFAIK, the client usually closes when you're sending invalid (improperly structured, unencrypted data to it).