I'm trying to send sockets to a server using Java:
_socket = new Socket(host, port);
_writer = new DataOutputStream(_socket.getOutputStream());
public void send(String data){
_writer.writeBytes( data );
_writer.flush();
}
I want to send data as a same Packet, and sometimes it's divide into multiples one. I don't know if it's clear enough, I'm missing some vocabulary.
If I send:
"0123456789abcdefghijklmnopqrstuvwxyz"
The server can possibly receive the data into 3 packets :
"0123456""789abcdefghijklmno""pqrstuvwxyz"Is there a way to don't separate the data you send into multiple packets ?
BufferedOutputStream seems to fix the problem.
BufferedOutputStream seems to fix the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With