public String receiveFrame(long timeOut) throws Exception { stompSocket.setSoTimeout((int)timeOut); InputStream is = stompSocket.getInputStream(); int c = 0; for (;;) { c = is.read(); if (c < 0) { throw new IOException("socket closed."); } else if (c == 0) { c = is.read(); if (c == '\n') { // end of frame return stringFromBuffer(inputBuffer); } else { inputBuffer.write(0); inputBuffer.write(c); } } else { inputBuffer.write(c); } } }
public String receiveFrame(long timeOut) throws Exception { stompSocket.setSoTimeout((int)timeOut); InputStream is = stompSocket.getInputStream(); int c = 0; for (;;) { c = is.read(); if (c < 0) { throw new IOException("socket closed."); } else if (c == 0) { c = is.read(); if (c == '\n') { // end of frame return stringFromBuffer(inputBuffer); } else { inputBuffer.write(0); inputBuffer.write(c); } } else { inputBuffer.write(c); } } }
public String receiveFrame(long timeOut) throws Exception { stompSocket.setSoTimeout((int)timeOut); InputStream is = stompSocket.getInputStream(); int c = 0; for (;;) { c = is.read(); if (c < 0) { throw new IOException("socket closed."); } else if (c == 0) { c = is.read(); if (c == '\n') { // end of frame return stringFromBuffer(inputBuffer); } else { inputBuffer.write(0); inputBuffer.write(c); } } else { inputBuffer.write(c); } } }
public String receiveFrame(long timeOut) throws Exception { stompSocket.setSoTimeout((int)timeOut); InputStream is = stompSocket.getInputStream(); int c = 0; for (;;) { c = is.read(); if (c < 0) { throw new IOException("socket closed."); } else if (c == 0) { c = is.read(); if (c == '\n') { // end of frame return stringFromBuffer(inputBuffer); } else { inputBuffer.write(0); inputBuffer.write(c); } } else { inputBuffer.write(c); } } }