C# 클래스 Squishy.Network.Connection

Represents an asynchronous TCP Connection that is synchronized for all critical operations. None of its methods are blocking. Therefore most actions are not completed when returning from a method but should be handled using the given events of this class. If this Connection is throttled, its Throttle will take care of the buffer size management. In that state it is illegal to change the buffersize of the throttled buffers (send- and/or receive- buffer respectively) since the throttling depends on a correctly adjusted buffersize.
파일 보기 프로젝트 열기: jaddie/WCell-Utility-Bot 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
DefaultReceiveBufferSize int

공개 메소드들

메소드 설명
BeginConnect ( IPEndPoint addr ) : void

Starts connecting to the given address.

BeginConnect ( string addr, int port ) : void

Starts connecting to the given host and port.

Connection ( ) : System
Disconnect ( ) : void

Marks this Connection Closing. If any data is pending to be sent it will disconnect after this data has been sent, else it will immediately call DisconnectNow.

DisconnectNow ( ) : bool

Disconnects this Client and releases all Resources after current read and send operations finished.

Send ( ByteBuffer buf ) : void

Sends the information from the given ByteBuffer to the current RemoteEndPoint.

Send ( byte buf ) : void

Sends the whole byte array to the current RemoteEndPoint.

Send ( byte buf, int offset, int length ) : void

Sends the contents of the given byte array to the current RemoteEndPoint, using the given offset and length.

Send ( object format ) : void

Sends string.Format(format.ToString(), args) to the current RemoteEndPoint.

SendLine ( object format ) : void

Sends a line to the current RemoteEndPoint.

SendNow ( ByteBuffer buf ) : void
SendNow ( object format ) : void

Sends string.Format(format.ToString(), args) to the current RemoteEndPoint.

SendNow ( string text ) : void

Sends string.Format(format.ToString(), args) to the current RemoteEndPoint.

ToString ( ) : string

비공개 메소드들

메소드 설명
BeginReceive ( ) : void
CalculateDownBps ( ) : int
CalculateUpBps ( ) : int
ConnectFailNotify ( Exception e ) : void
ConnectedNotify ( ) : void
ConnectingNotify ( ) : void
Connection ( Socket s ) : System
ContinueConnect ( ) : void
ContinueRead ( ) : void
ContinueReadUnlocked ( ) : void
ContinueSend ( ) : void
DisconnectNow ( bool connectionLost ) : bool
DisconnectedNotify ( bool connectionLost ) : void
DisconnectingNotify ( bool connectionLost ) : void
OnConnected ( IAsyncResult ar ) : void
OnRecieved ( IAsyncResult ar ) : void
OnResolved ( IAsyncResult ar ) : void
OnSend ( IAsyncResult ar ) : void
ReceivedNotify ( ByteBuffer buf ) : void
SentNotify ( int amount, bool hasRemaining ) : void
SetRcvBufferSize ( int value, bool throttleAccess ) : void
SetSendBufferSize ( int value, bool throttleAcces ) : void
SetThrottle ( Throttle newThrottle ) : void

메소드 상세

BeginConnect() 공개 메소드

Starts connecting to the given address.
public BeginConnect ( IPEndPoint addr ) : void
addr System.Net.IPEndPoint
리턴 void

BeginConnect() 공개 메소드

Starts connecting to the given host and port.
public BeginConnect ( string addr, int port ) : void
addr string
port int
리턴 void

Connection() 공개 메소드

public Connection ( ) : System
리턴 System

Disconnect() 공개 메소드

Marks this Connection Closing. If any data is pending to be sent it will disconnect after this data has been sent, else it will immediately call DisconnectNow.
public Disconnect ( ) : void
리턴 void

DisconnectNow() 공개 메소드

Disconnects this Client and releases all Resources after current read and send operations finished.
public DisconnectNow ( ) : bool
리턴 bool

Send() 공개 메소드

Sends the information from the given ByteBuffer to the current RemoteEndPoint.
public Send ( ByteBuffer buf ) : void
buf ByteBuffer
리턴 void

Send() 공개 메소드

Sends the whole byte array to the current RemoteEndPoint.
public Send ( byte buf ) : void
buf byte
리턴 void

Send() 공개 메소드

Sends the contents of the given byte array to the current RemoteEndPoint, using the given offset and length.
public Send ( byte buf, int offset, int length ) : void
buf byte
offset int
length int
리턴 void

Send() 공개 메소드

Sends string.Format(format.ToString(), args) to the current RemoteEndPoint.
public Send ( object format ) : void
format object
리턴 void

SendLine() 공개 메소드

Sends a line to the current RemoteEndPoint.
public SendLine ( object format ) : void
format object
리턴 void

SendNow() 공개 메소드

public SendNow ( ByteBuffer buf ) : void
buf ByteBuffer
리턴 void

SendNow() 공개 메소드

Sends string.Format(format.ToString(), args) to the current RemoteEndPoint.
public SendNow ( object format ) : void
format object
리턴 void

SendNow() 공개 메소드

Sends string.Format(format.ToString(), args) to the current RemoteEndPoint.
public SendNow ( string text ) : void
text string
리턴 void

ToString() 공개 메소드

public ToString ( ) : string
리턴 string

프로퍼티 상세

DefaultReceiveBufferSize 공개적으로 정적으로 프로퍼티

public static int DefaultReceiveBufferSize
리턴 int