Package 

Class PseudoTCPBase

  • All Implemented Interfaces:

    
    public class PseudoTCPBase
    
                        

    Main protocol logic class. To open connection use connect method. Then recv and send operations may be used for data transfer. To operate this class requires implementation of PseudoTcpNotify. Also it must be notified about the time progress. Based on https://developers.google.com/talk/libjingle/

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      short getM_rwnd_scale()
      short getM_swnd_scale()
      void connect() Enqueues connect message and starts connection procedure
      void notifyMTU(int mtu) Set the MTU (maximum transmission unit) value
      int getMTU()
      static long now()
      long getNextClock(long now) Evaluate next interval between getNextClock calls.
      void notifyClock(long now) This method should be called in time intervals retrieved from getNextClock
      synchronized boolean notifyPacket(Array<byte> buffer, int len) Use this method to notify protocol about packets received from the network
      synchronized int recv(Array<byte> buffer, int offset, int len) Reads the data available in receive buffer.
      int recv(Array<byte> buffer, int len) Reads the data available in receive buffer.
      int send(Array<byte> buffer, int len) Enqueues data in the send buffer
      synchronized int send(Array<byte> buffer, int offset, int len) Enqueues data in the send buffer
      static Segment parseSeg(Array<byte> buffer, int size) Method can be used in debugging utilities to parse PTCP segment
      static String segToStr(Segment seg) Can be used to convert segments to text
      PseudoTcpState getState()
      Object getAckNotify()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PseudoTCPBase

        PseudoTCPBase(PseudoTcpNotify notify, long conv)
        Parameters:
        notify - PseudoTcpNotify implementation
        conv - the conversation number used by this instance
    • Method Detail

      • connect

         void connect()

        Enqueues connect message and starts connection procedure

      • notifyMTU

         void notifyMTU(int mtu)

        Set the MTU (maximum transmission unit) value

        Parameters:
        mtu - the new MTU value
      • now

         static long now()
      • getNextClock

         long getNextClock(long now)

        Evaluate next interval between getNextClock calls. It is based on current protocol action timeout

        Parameters:
        now - current timestamp
      • notifyClock

         void notifyClock(long now)

        This method should be called in time intervals retrieved from getNextClock

        Parameters:
        now - current timestamp
      • notifyPacket

         synchronized boolean notifyPacket(Array<byte> buffer, int len)

        Use this method to notify protocol about packets received from the network

        Parameters:
        buffer - packet's data
        len - data length
      • recv

         synchronized int recv(Array<byte> buffer, int offset, int len)

        Reads the data available in receive buffer. This method returns 0 if there's no data available at the moment.

        Parameters:
        buffer - destination buffer
        offset - destination buffer's offset
        len - bytes to be read
      • recv

         int recv(Array<byte> buffer, int len)

        Reads the data available in receive buffer. This method returns 0 if there's no data available at the moment.

        Parameters:
        buffer - destination buffer
        len - bytes to be read
      • send

         int send(Array<byte> buffer, int len)

        Enqueues data in the send buffer

        Parameters:
        buffer - source data buffer
        len - bytes count to be sent
      • send

         synchronized int send(Array<byte> buffer, int offset, int len)

        Enqueues data in the send buffer

        Parameters:
        buffer - source data buffer
        offset - offset of the source data buffer
        len - bytes count to be sent
      • parseSeg

         static Segment parseSeg(Array<byte> buffer, int size)

        Method can be used in debugging utilities to parse PTCP segment

        Parameters:
        buffer - data to parse
        size - length of the data in the buffer