/** * Connect to a remote TSAP that is listening at the destination address. * * @param address * remote IP * @param port * remote port * @return the Connection Object * @throws IOException * is thrown if connection was unsuccessful. */ public TConnection connectTo(InetAddress address, int port) throws IOException { return connectTo(address, port, null, -1); }
/** * Use this constructor to create a client ACSE Service Access Point (SAP) that will start connections to remote * ACSE SAPs. Once constructed the AcseSAP contains a public TSAP that can be accessed to set its configuration. */ public ClientAcseSap() { tSap = new ClientTSap(); }
/** * Set the maxTPDUSize. The default maxTPduSize is 65531 (see RFC 1006). * * @param maxTPduSizeParam * The maximum length is equal to 2^(maxTPduSizeParam) octets. Note that the actual TSDU size that can be * transfered is equal to TPduSize-3. Default is 65531 octets (see RFC 1006), 7 <= maxTPduSizeParam * <= 16, needs to be set before listening or connecting */ public void setMaxTPduSizeParameter(int maxTPduSizeParam) { acseSap.tSap.setMaxTPDUSizeParam(maxTPduSizeParam); }
ClientTSap tSAP = new ClientTSap(); tSAP.setMaxTPDUSizeParam(7); TConnection tConnection = null; tConnection = tSAP.connectTo(address, port);
TConnection(Socket socket, int maxTPduSizeParam, int messageTimeout, int messageFragmentTimeout, ServerThread serverThread) throws IOException { if (maxTPduSizeParam < 7 || maxTPduSizeParam > 16) { throw new RuntimeException("maxTPduSizeParam is incorrect"); } this.socket = socket; os = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream())); is = new DataInputStream(new BufferedInputStream(socket.getInputStream())); synchronized (socket) { connectionCounter++; connectionCounter %= 65520; if (connectionCounter == 0) { connectionCounter = 1; // some servers do not like srcRef 0 } srcRef = connectionCounter; } this.messageTimeout = messageTimeout; this.messageFragmentTimeout = messageFragmentTimeout; this.maxTPduSizeParam = maxTPduSizeParam; maxTPduSize = ClientTSap.getMaxTPDUSize(maxTPduSizeParam); this.serverThread = serverThread; }
ClientAssociation(InetAddress address, int port, InetAddress localAddr, int localPort, String authenticationParameter, ClientAcseSap acseSap, int proposedMaxMmsPduSize, int proposedMaxServOutstandingCalling, int proposedMaxServOutstandingCalled, int proposedDataStructureNestingLevel, byte[] servicesSupportedCalling, int responseTimeout, int messageFragmentTimeout, ClientEventListener reportListener) throws IOException { this.responseTimeout = responseTimeout; acseSap.tSap.setMessageFragmentTimeout(messageFragmentTimeout); acseSap.tSap.setMessageTimeout(responseTimeout); negotiatedMaxPduSize = proposedMaxMmsPduSize; this.reportListener = reportListener; associate(address, port, localAddr, localPort, authenticationParameter, acseSap, proposedMaxMmsPduSize, proposedMaxServOutstandingCalling, proposedMaxServOutstandingCalled, proposedDataStructureNestingLevel, servicesSupportedCalling); acseAssociation.setMessageTimeout(0); clientReceiver = new ClientReceiver(negotiatedMaxPduSize); clientReceiver.start(); }
TConnection(Socket socket, int maxTPduSizeParam, int messageTimeout, int messageFragmentTimeout, ServerThread serverThread) throws IOException { if (maxTPduSizeParam < 7 || maxTPduSizeParam > 16) { throw new RuntimeException("maxTPduSizeParam is incorrect"); } this.socket = socket; os = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream())); is = new DataInputStream(new BufferedInputStream(socket.getInputStream())); synchronized (socket) { connectionCounter++; connectionCounter %= 65520; if (connectionCounter == 0) { connectionCounter = 1; // some servers do not like srcRef 0 } srcRef = connectionCounter; } this.messageTimeout = messageTimeout; this.messageFragmentTimeout = messageFragmentTimeout; this.maxTPduSizeParam = maxTPduSizeParam; maxTPduSize = ClientTSap.getMaxTPDUSize(maxTPduSizeParam); this.serverThread = serverThread; }
ClientAssociation(InetAddress address, int port, InetAddress localAddr, int localPort, String authenticationParameter, ClientAcseSap acseSap, int proposedMaxMmsPduSize, int proposedMaxServOutstandingCalling, int proposedMaxServOutstandingCalled, int proposedDataStructureNestingLevel, byte[] servicesSupportedCalling, int responseTimeout, int messageFragmentTimeout, ClientEventListener reportListener) throws IOException { this.responseTimeout = responseTimeout; acseSap.tSap.setMessageFragmentTimeout(messageFragmentTimeout); acseSap.tSap.setMessageTimeout(responseTimeout); negotiatedMaxPduSize = proposedMaxMmsPduSize; this.reportListener = reportListener; associate(address, port, localAddr, localPort, authenticationParameter, acseSap, proposedMaxMmsPduSize, proposedMaxServOutstandingCalling, proposedMaxServOutstandingCalled, proposedDataStructureNestingLevel, servicesSupportedCalling); acseAssociation.setMessageTimeout(0); clientReceiver = new ClientReceiver(negotiatedMaxPduSize); clientReceiver.start(); }
/** * Connect to a remote TSAP that is listening at the destination address. * * @param address * remote IP * @param port * remote port * @return the Connection Object * @throws IOException * is thrown if connection was unsuccessful. */ public TConnection connectTo(InetAddress address, int port) throws IOException { return connectTo(address, port, null, -1); }
/** * Use this constructor to create a client ACSE Service Access Point (SAP) that will start connections to remote * ACSE SAPs. Once constructed the AcseSAP contains a public TSAP that can be accessed to set its configuration. */ public ClientAcseSap() { tSap = new ClientTSap(); }
/** * Set the maxTPDUSize. The default maxTPduSize is 65531 (see RFC 1006). * * @param maxTPduSizeParam * The maximum length is equal to 2^(maxTPduSizeParam) octets. Note that the actual TSDU size that can be * transfered is equal to TPduSize-3. Default is 65531 octets (see RFC 1006), 7 <= maxTPduSizeParam * <= 16, needs to be set before listening or connecting */ public void setMaxTPduSizeParameter(int maxTPduSizeParam) { acseSap.tSap.setMaxTPDUSizeParam(maxTPduSizeParam); }
TConnection(Socket socket, int maxTPduSizeParam, int messageTimeout, int messageFragmentTimeout, ServerThread serverThread) throws IOException { if (maxTPduSizeParam < 7 || maxTPduSizeParam > 16) { throw new RuntimeException("maxTPduSizeParam is incorrect"); } this.socket = socket; os = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream())); is = new DataInputStream(new BufferedInputStream(socket.getInputStream())); synchronized (socket) { connectionCounter++; connectionCounter %= 65520; if (connectionCounter == 0) { connectionCounter = 1; // some servers do not like srcRef 0 } srcRef = connectionCounter; } this.messageTimeout = messageTimeout; this.messageFragmentTimeout = messageFragmentTimeout; this.maxTPduSizeParam = maxTPduSizeParam; maxTPduSize = ClientTSap.getMaxTPDUSize(maxTPduSizeParam); this.serverThread = serverThread; }
/** * Connect to a remote TSAP that is listening at the destination address. * * @param address * remote IP * @param port * remote port * @return the Connection Object * @throws IOException * is thrown if connection was unsuccessful. */ public TConnection connectTo(InetAddress address, int port) throws IOException { return connectTo(address, port, null, -1); }
/** * Use this constructor to create a client ACSE Service Access Point (SAP) that will start connections to remote * ACSE SAPs. Once constructed the AcseSAP contains a public TSAP that can be accessed to set its configuration. */ public ClientAcseSap() { tSap = new ClientTSap(); }
/** * Use this constructor to create a default client SAP. */ public ClientSap() { acseSap = new ClientAcseSap(); acseSap.tSap.tSelLocal = DEFAULT_TSEL_LOCAL; acseSap.tSap.tSelRemote = DEFAULT_TSEL_REMOTE; acseSap.tSap.setMaxTPDUSizeParam(DEFAUTL_TPDU_SIZE_PARAMETER); }
if (newMaxTPDUSizeParam < maxTPduSizeParam) { maxTPduSizeParam = newMaxTPDUSizeParam; maxTPduSize = ClientTSap.getMaxTPDUSize(maxTPduSizeParam);
ssduLengths.add(0, spduHeader.length); tConnection = tSAP.connectTo(address, port, localAddr, localPort);
public ClientAcseSap(SocketFactory socketFactory) { tSap = new ClientTSap(socketFactory); }
/** * Use this constructor to create a default client SAP. */ public ClientSap() { acseSap = new ClientAcseSap(); acseSap.tSap.tSelLocal = DEFAULT_TSEL_LOCAL; acseSap.tSap.tSelRemote = DEFAULT_TSEL_REMOTE; acseSap.tSap.setMaxTPDUSizeParam(DEFAUTL_TPDU_SIZE_PARAMETER); }
if (newMaxTPDUSizeParam < maxTPduSizeParam) { maxTPduSizeParam = newMaxTPDUSizeParam; maxTPduSize = ClientTSap.getMaxTPDUSize(maxTPduSizeParam);