Original Post
When I'm sending messages it will not actually send the text unless I close the connection, but I need to send multiple messages back and fourth during a single connection. heres my source: The receiver source is thanks
Socket socket = new Socket("localhost", 3333);
DataOutputStream o = new DataOutputStream(socket.getOutputStream());
o.writeBytes("hello");
//closing it is the only way to get it to send, using either
o.close();
//or
socket.close()
ServerSocket listenSocket = new ServerSocket(3333);
BufferedReader inFromConn = new BufferedReader(new InputStreamReader(socket.getInputStream()));
while(!inFromConn.ready());
System.out.println(inFromConn.readLine()); //isn't called until the connection is closed