Atavism Version 2018.1AGIS API

atavism.server.network.rdp
Class RDPConnection

java.lang.Object
  extended by atavism.server.network.ClientConnection
      extended by atavism.server.network.rdp.RDPConnection
All Implemented Interfaces:
java.lang.Cloneable

public class RDPConnection
extends ClientConnection
implements java.lang.Cloneable


Nested Class Summary
 
Nested classes/interfaces inherited from class atavism.server.network.ClientConnection
ClientConnection.AcceptCallback, ClientConnection.MessageCallback
 
Field Summary
static int aggregatedMsgId
           
static int CLOSE_WAIT
           
static int CLOSED
           
protected static int defaultReceiveBufferSize
           
static int fragmentMsgId
           
static int LISTEN
           
static int OPEN
           
static int SYN_RCVD
           
static int SYN_SENT
           
 
Fields inherited from class atavism.server.network.ClientConnection
aggregatedReceives, aggregatedSends, connectionTypeRDP, connectionTypeTCP, connectionTypeUDP, lock, logMessageContents, packetAggregator, receivedMessagesAggregated, sentMessagesAggregated, unaggregatedReceives, unaggregatedSends
 
Constructor Summary
RDPConnection()
           
 
Method Summary
 boolean canSend()
           
 boolean canSendInternal()
           
 void close()
          sends a reset packet to the other side, sets the connection to CLOSE_WAIT. the rdpserver will close the connection for real after waiting for a bit
 int connectionKind()
           
 void connectionReset()
           
static boolean fragmentedBuffer(AOByteBuffer buf)
           
 ClientConnection.MessageCallback getCallback()
           
 java.nio.channels.DatagramChannel getDatagramChannel()
           
 long getInitialSendSeqNum()
           
 long getLastSentMessage()
          returns when the last message was sent to this user set by the messageserver.send()
 int getLocalPort()
           
 long getMaxReceiveSegmentSize()
           
 long getMaxSendUnacks()
           
 long getRcvCur()
           
 long getRcvIrs()
           
 long getRcvMax()
           
 java.net.InetAddress getRemoteAddr()
           
 int getRemotePort()
           
 long getSBufMax()
           
 long getSendNextSeqNum()
           
 long getSendUnackd()
           
 int getState()
           
 java.lang.String IPAndPort()
           
 boolean isClosed()
           
 boolean isClosing()
           
 boolean isOpen()
           
 boolean isSequenced()
           
 void isSequenced(boolean isSequenced)
           
 void open(java.net.InetAddress address, int remotePort, boolean isSequenced)
           
 void open(java.net.InetAddress address, int remotePort, boolean isSequenced, int receiveBufferSize)
           
 void open(java.net.InetAddress address, java.lang.Integer remotePort, java.lang.Integer localPort, boolean isSequenced)
           
 void open(java.net.InetAddress address, java.lang.Integer remotePort, java.lang.Integer localPort, boolean isSequenced, int receiveBufferSize)
           
 void open(java.lang.String hostname, int remotePort)
           
 void open(java.lang.String hostname, int remotePort, boolean isSequenced)
           
 void open(java.lang.String hostname, int remotePort, boolean isSequenced, int receiveBufferSize)
           
 void open(java.lang.String hostname, int remotePort, int localPort, boolean isSequenced, int receiveBufferSize)
           
protected  RDPPacket receivePacket()
           
 void registerMessageCallback(ClientConnection.MessageCallback pcallback)
           
 void send(AOByteBuffer buf)
          the external interface to the sending machinery.
 boolean sendIfPossible(AOByteBuffer buf)
          This version of send does packet fragmenting so that it happens _above_ the level of the packet aggregator.
 boolean sendInternal(AOByteBuffer buf)
          main method to send data over the connection.
 int sendMultibuf(java.util.List<AOByteBuffer> subMessages, int currentSize)
          This method sends multiple messages.
protected  void sendPacketImmediate(RDPPacket packet, boolean retransmit)
           
 void setCallback(ClientConnection.MessageCallback cb)
           
 void setDatagramChannel(java.nio.channels.DatagramChannel dc)
           
 void setInitialSendSeqNum(long seqNum)
           
 void setLastSentMessage(long time)
           
 void setLocalPort(int port)
           
 void setMaxReceiveSegmentSize(int size)
           
 void setMaxReceiveSegmentSize(long max)
           
 void setMaxSendUnacks(long max)
           
static void setOverrideMaxSendUnacks(int max)
          this will override the maxsendunack variable that the client sends us
 void setRcvCur(long rcvCur)
           
 void setRcvIrs(long rcvIrs)
           
 void setRcvMax(long max)
           
 void setRemoteAddr(java.net.InetAddress remoteAddr)
           
 void setRemotePort(int port)
           
 void setSBufMax(long max)
           
 void setSendNextSeqNum(long num)
           
 void setSendUnackd(long num)
           
 void setState(int state)
           
 java.lang.String toString()
           
static java.lang.String toStringState(int i)
           
 java.lang.String toStringVerbose()
           
 long unackBufferRemaining()
          returns the number of packets that can be added before the con buffer gets full
 int unackLength()
           
 
Methods inherited from class atavism.server.network.ClientConnection
getAggregator, getAssociation, getLock, getLogMessageContents, setAssociation, setLogMessageContents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OPEN

public static final int OPEN
See Also:
Constant Field Values

LISTEN

public static final int LISTEN
See Also:
Constant Field Values

CLOSED

public static final int CLOSED
See Also:
Constant Field Values

SYN_SENT

public static final int SYN_SENT
See Also:
Constant Field Values

SYN_RCVD

public static final int SYN_RCVD
See Also:
Constant Field Values

CLOSE_WAIT

public static final int CLOSE_WAIT
See Also:
Constant Field Values

defaultReceiveBufferSize

protected static int defaultReceiveBufferSize

aggregatedMsgId

public static final int aggregatedMsgId
See Also:
Constant Field Values

fragmentMsgId

public static final int fragmentMsgId
See Also:
Constant Field Values
Constructor Detail

RDPConnection

public RDPConnection()
Method Detail

registerMessageCallback

public void registerMessageCallback(ClientConnection.MessageCallback pcallback)
Specified by:
registerMessageCallback in class ClientConnection

connectionKind

public int connectionKind()
Specified by:
connectionKind in class ClientConnection

isOpen

public boolean isOpen()
Specified by:
isOpen in class ClientConnection

isClosed

public boolean isClosed()

isClosing

public boolean isClosing()

open

public void open(java.lang.String hostname,
                 int remotePort)
Specified by:
open in class ClientConnection

open

public void open(java.lang.String hostname,
                 int remotePort,
                 int localPort,
                 boolean isSequenced,
                 int receiveBufferSize)
          throws java.net.UnknownHostException,
                 java.net.BindException,
                 AORuntimeException,
                 java.lang.InterruptedException,
                 java.io.IOException
Throws:
java.net.UnknownHostException
java.net.BindException
AORuntimeException
java.lang.InterruptedException
java.io.IOException

open

public void open(java.lang.String hostname,
                 int remotePort,
                 boolean isSequenced)
          throws java.net.UnknownHostException,
                 java.net.BindException,
                 AORuntimeException,
                 java.lang.InterruptedException,
                 java.io.IOException
Throws:
java.net.UnknownHostException
java.net.BindException
AORuntimeException
java.lang.InterruptedException
java.io.IOException

open

public void open(java.lang.String hostname,
                 int remotePort,
                 boolean isSequenced,
                 int receiveBufferSize)
          throws java.net.UnknownHostException,
                 java.net.BindException,
                 AORuntimeException,
                 java.lang.InterruptedException,
                 java.io.IOException
Throws:
java.net.UnknownHostException
java.net.BindException
AORuntimeException
java.lang.InterruptedException
java.io.IOException

open

public void open(java.net.InetAddress address,
                 int remotePort,
                 boolean isSequenced)
          throws java.net.UnknownHostException,
                 java.net.BindException,
                 AORuntimeException,
                 java.lang.InterruptedException,
                 java.io.IOException
Throws:
java.net.UnknownHostException
java.net.BindException
AORuntimeException
java.lang.InterruptedException
java.io.IOException

open

public void open(java.net.InetAddress address,
                 int remotePort,
                 boolean isSequenced,
                 int receiveBufferSize)
          throws java.net.UnknownHostException,
                 java.net.BindException,
                 AORuntimeException,
                 java.lang.InterruptedException,
                 java.io.IOException
Throws:
java.net.UnknownHostException
java.net.BindException
AORuntimeException
java.lang.InterruptedException
java.io.IOException

open

public void open(java.net.InetAddress address,
                 java.lang.Integer remotePort,
                 java.lang.Integer localPort,
                 boolean isSequenced)
          throws java.net.BindException,
                 AORuntimeException,
                 java.lang.InterruptedException,
                 java.io.IOException
Throws:
java.net.BindException
AORuntimeException
java.lang.InterruptedException
java.io.IOException

open

public void open(java.net.InetAddress address,
                 java.lang.Integer remotePort,
                 java.lang.Integer localPort,
                 boolean isSequenced,
                 int receiveBufferSize)
          throws java.net.BindException,
                 AORuntimeException,
                 java.lang.InterruptedException,
                 java.io.IOException
Throws:
java.net.BindException
AORuntimeException
java.lang.InterruptedException
java.io.IOException

IPAndPort

public java.lang.String IPAndPort()
Specified by:
IPAndPort in class ClientConnection

connectionReset

public void connectionReset()
Specified by:
connectionReset in class ClientConnection

send

public void send(AOByteBuffer buf)
the external interface to the sending machinery. Enqueues the message with the connection's aggregator

Specified by:
send in class ClientConnection

sendIfPossible

public boolean sendIfPossible(AOByteBuffer buf)
This version of send does packet fragmenting so that it happens _above_ the level of the packet aggregator.

Specified by:
sendIfPossible in class ClientConnection

sendInternal

public boolean sendInternal(AOByteBuffer buf)
main method to send data over the connection. copies the bytebuffer before sending it. Returns false and _doesn't_ send the packet because if it would exceed the allowed count of unacked packets. In that case, the packet is added to the list of pending packets for the connection

Specified by:
sendInternal in class ClientConnection

fragmentedBuffer

public static boolean fragmentedBuffer(AOByteBuffer buf)

sendMultibuf

public int sendMultibuf(java.util.List<AOByteBuffer> subMessages,
                        int currentSize)
This method sends multiple messages. Packet fragmentation has already been done at a higher level, so there are two cases it must deal with: 1. The normal case is that the first messages in subMessages are small messages that are combined into a single aggregatedRDP message and sent. 2. The other case is that the first message in subMessages is a FragmentedMessage which is sent by itself, not combined with other messages.

Specified by:
sendMultibuf in class ClientConnection

canSend

public boolean canSend()
Specified by:
canSend in class ClientConnection

canSendInternal

public boolean canSendInternal()
Specified by:
canSendInternal in class ClientConnection

unackBufferRemaining

public long unackBufferRemaining()
returns the number of packets that can be added before the con buffer gets full


unackLength

public int unackLength()

close

public void close()
sends a reset packet to the other side, sets the connection to CLOSE_WAIT. the rdpserver will close the connection for real after waiting for a bit

Specified by:
close in class ClientConnection

setMaxReceiveSegmentSize

public void setMaxReceiveSegmentSize(int size)

isSequenced

public boolean isSequenced()

isSequenced

public void isSequenced(boolean isSequenced)

setState

public void setState(int state)

getState

public int getState()

getDatagramChannel

public java.nio.channels.DatagramChannel getDatagramChannel()

setDatagramChannel

public void setDatagramChannel(java.nio.channels.DatagramChannel dc)

getRemotePort

public int getRemotePort()

setRemotePort

public void setRemotePort(int port)

getLocalPort

public int getLocalPort()

setLocalPort

public void setLocalPort(int port)

getRemoteAddr

public java.net.InetAddress getRemoteAddr()

setRemoteAddr

public void setRemoteAddr(java.net.InetAddress remoteAddr)

toString

public java.lang.String toString()
Overrides:
toString in class ClientConnection

toStringVerbose

public java.lang.String toStringVerbose()

sendPacketImmediate

protected void sendPacketImmediate(RDPPacket packet,
                                   boolean retransmit)

receivePacket

protected RDPPacket receivePacket()

getCallback

public ClientConnection.MessageCallback getCallback()

setCallback

public void setCallback(ClientConnection.MessageCallback cb)

getMaxSendUnacks

public long getMaxSendUnacks()

setMaxSendUnacks

public void setMaxSendUnacks(long max)

getInitialSendSeqNum

public long getInitialSendSeqNum()

setInitialSendSeqNum

public void setInitialSendSeqNum(long seqNum)

getSendNextSeqNum

public long getSendNextSeqNum()

setSendNextSeqNum

public void setSendNextSeqNum(long num)

getSendUnackd

public long getSendUnackd()

setSendUnackd

public void setSendUnackd(long num)

getRcvCur

public long getRcvCur()

setRcvCur

public void setRcvCur(long rcvCur)

getRcvMax

public long getRcvMax()

setRcvMax

public void setRcvMax(long max)

getRcvIrs

public long getRcvIrs()

setRcvIrs

public void setRcvIrs(long rcvIrs)

getSBufMax

public long getSBufMax()

setSBufMax

public void setSBufMax(long max)

setMaxReceiveSegmentSize

public void setMaxReceiveSegmentSize(long max)

getMaxReceiveSegmentSize

public long getMaxReceiveSegmentSize()

toStringState

public static java.lang.String toStringState(int i)

setOverrideMaxSendUnacks

public static void setOverrideMaxSendUnacks(int max)
this will override the maxsendunack variable that the client sends us


getLastSentMessage

public long getLastSentMessage()
returns when the last message was sent to this user set by the messageserver.send()


setLastSentMessage

public void setLastSentMessage(long time)


Copyright © 2018 Dragonsan Studios Sp. z o.o.