/** * Listens for a new PDU and writes it into the given buffer. Decodes all ACSE and lower layer headers. The * resulting buffer's position points to the beginning of the ACSE SDU. The limit will point to the byte after the * last byte of the ACSE SDU. * * @param pduBuffer * buffer to write the received pdu into * @throws DecodingException * if a decoding error occurs * @throws IOException * if a non recoverable error occurs. Afterwards the association should be closed by the user * @throws TimeoutException * if a timeout occurs */ public void receive(ByteBuffer pduBuffer) throws DecodingException, IOException, TimeoutException { if (connected == false) { throw new IllegalStateException("ACSE Association not connected"); } tConnection.receive(pduBuffer); decodeSessionLayer(pduBuffer); decodePresentationLayer(pduBuffer); }
/** * Listens for a new PDU and writes it into the given buffer. Decodes all ACSE and lower layer headers. The * resulting buffer's position points to the beginning of the ACSE SDU. The limit will point to the byte after the * last byte of the ACSE SDU. * * @param pduBuffer * buffer to write the received pdu into * @throws DecodingException * if a decoding error occurs * @throws IOException * if a non recoverable error occurs. Afterwards the association should be closed by the user * @throws TimeoutException * if a timeout occurs */ public byte[] receive(ByteBuffer pduBuffer) throws DecodingException, IOException, TimeoutException { if (connected == false) { throw new IllegalStateException("ACSE Association not connected"); } tConnection.receive(pduBuffer); decodeSessionLayer(pduBuffer); return decodePresentationLayer(pduBuffer); }
/** * Listens for a new PDU and writes it into the given buffer. Decodes all ACSE and lower layer headers. The * resulting buffer's position points to the beginning of the ACSE SDU. The limit will point to the byte after the * last byte of the ACSE SDU. * * @param pduBuffer * buffer to write the received pdu into * @throws DecodingException * if a decoding error occurs * @throws IOException * if a non recoverable error occurs. Afterwards the association should be closed by the user * @throws TimeoutException * if a timeout occurs */ public byte[] receive(ByteBuffer pduBuffer) throws DecodingException, IOException, TimeoutException { if (connected == false) { throw new IllegalStateException("ACSE Association not connected"); } tConnection.receive(pduBuffer); decodeSessionLayer(pduBuffer); return decodePresentationLayer(pduBuffer); }
tConnection.receive(pduBuffer); } catch (TimeoutException e) { throw new IOException("ResponseTimeout waiting for connection response.", e);
tConnection.receive(pduBuffer); } catch (TimeoutException e) { throw new IOException("ResponseTimeout waiting for connection response.", e);
@Override public void connectionIndication(TConnection tConnection) { ByteBuffer pduBuffer = ByteBuffer.allocate(600); try { tConnection.receive(pduBuffer); } catch (IOException e1) { System.err.println("Caught exception reading data:" + e1.getMessage()); e1.printStackTrace(); return; } catch (TimeoutException e) { System.err.println("Caught TimeoutException reading data:" + e.getMessage()); e.printStackTrace(); } try { tConnection.send(pduBuffer.array(), pduBuffer.position(), pduBuffer.limit() - pduBuffer.position()); } catch (IOException e) { System.err.println("Caught exception writing data:"); e.printStackTrace(); return; } }
tConnection.receive(pduBuffer); } catch (TimeoutException e) { throw new IOException("ResponseTimeout waiting for connection response.", e);
int parameterLength; tConnection.receive(pduBuffer);
int parameterLength; tConnection.receive(pduBuffer);
int parameterLength; tConnection.receive(pduBuffer);
tConnection.receive(pduBuffer);