public void send(byte[] tsdu, int offset, int length) throws IOException { List<byte[]> tsdus = new ArrayList<>(); tsdus.add(tsdu); List<Integer> offsets = new ArrayList<>(); offsets.add(offset); List<Integer> lengths = new ArrayList<>(); lengths.add(length); send(tsdus, offsets, lengths); }
@Override public void run() { TConnection tConnection; try { tConnection = new TConnection(socket, maxTPduSizeParam, messageTimeout, messageFragmentTimeout, serverThread); } catch (IOException e) { synchronized (ServerThread.this) { numConnections--; } return; } try { tConnection.listenForCR(); } catch (IOException e) { tConnection.close(); return; } connectionListener.connectionIndication(tConnection); } }
/** * Disconnects by sending a disconnect request at the Transport Layer and then closing the socket. */ public void disconnect() { connected = false; if (tConnection != null) { tConnection.disconnect(); } }
lengthList.add(testData.length); tConnection.send(testDataList, offsetList, lengthList); tConnection.setMessageTimeout(1000); tConnection.receive(pduBuffer); tConnection.disconnect();
/** * Closes the connection simply by closing the socket. */ public void close() { connected = false; if (tConnection != null) { tConnection.close(); } }
socket = socketFactory.createSocket(address, port, localAddr, localPort); TConnection tConnection = new TConnection(socket, maxTPDUSizeParam, messageTimeout, messageFragmentTimeout, null); tConnection.tSelRemote = tSelRemote; tConnection.tSelLocal = tSelLocal; tConnection.startConnection();
/** * 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); }
public void setMessageTimeout(int i) { tConnection.setMessageTimeout(i); }
public int getMessageTimeout() { return tConnection.getMessageTimeout(); }
/** * Closes the connection simply by closing the socket. */ public void close() { connected = false; if (tConnection != null) { tConnection.close(); } }
socket = socketFactory.createSocket(address, port, localAddr, localPort); TConnection tConnection = new TConnection(socket, maxTPDUSizeParam, messageTimeout, messageFragmentTimeout, null); tConnection.tSelRemote = tSelRemote; tConnection.tSelLocal = tSelLocal; tConnection.startConnection();
/** * 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); }
public void setMessageTimeout(int i) { tConnection.setMessageTimeout(i); }
public int getMessageTimeout() { return tConnection.getMessageTimeout(); }
@Override public void run() { TConnection tConnection; try { tConnection = new TConnection(socket, maxTPduSizeParam, messageTimeout, messageFragmentTimeout, serverThread); } catch (IOException e) { synchronized (ServerThread.this) { numConnections--; } return; } try { tConnection.listenForCR(); } catch (IOException e) { tConnection.close(); return; } connectionListener.connectionIndication(tConnection); } }
public void send(byte[] tsdu, int offset, int length) throws IOException { List<byte[]> tsdus = new ArrayList<>(); tsdus.add(tsdu); List<Integer> offsets = new ArrayList<>(); offsets.add(offset); List<Integer> lengths = new ArrayList<>(); lengths.add(length); send(tsdus, offsets, lengths); }
/** * Closes the connection simply by closing the socket. */ public void close() { connected = false; if (tConnection != null) { tConnection.close(); } }