Class TcpProxy


  • public class TcpProxy
    extends Object
    TCP proxy object
    • Constructor Detail

      • TcpProxy

        protected TcpProxy​(NXCSession session,
                           int channelId)
                    throws IOException
        TODO
        Parameters:
        session - TODO
        channelId - TODO
        Throws:
        IOException - TODO
    • Method Detail

      • close

        public void close()
        Close proxy session. Calling this method will also close both input and output streams.
      • localClose

        protected void localClose()
        Close local resources associated with proxy session. Should only be called by remote proxy session closure notification handler.
      • isClosed

        public boolean isClosed()
        Check if proxy session is closed.
        Returns:
        true if proxy session is closed
      • getInputStream

        public InputStream getInputStream()
        Get input stream for this TCP proxy.
        Returns:
        input stream for this TCP proxy
      • getOutputStream

        public OutputStream getOutputStream()
        Get output stream for this TCP proxy.
        Returns:
        output stream for this TCP proxy
      • getChannelId

        protected int getChannelId()
        Get channel ID
        Returns:
        channel ID
      • getSizeThreshold

        public int getSizeThreshold()
        Get current size threshold.
        Returns:
        current size threshold
      • getTimeThreshold

        public int getTimeThreshold()
        Get current time threshold.
        Returns:
        current time threshold
      • setBufferingThresholds

        public void setBufferingThresholds​(int sizeThreshold,
                                           int timeThreshold)
        Set write buffering thresholds. If these parameters are non-zero, proxy object will buffer outgoing data until it reach size threshold, but not longer that time threshold.
        Parameters:
        sizeThreshold - data size threshold in bytes
        timeThreshold - time threshold in milliseconds
      • processRemoteData

        protected void processRemoteData​(byte[] data)
        Process data received from remote end
        Parameters:
        data - data received