C# Class SuperSocket.SocketEngine.SocketSession

Socket Session, all application session should base on this class
Inheritance: ISocketSession
ファイルを表示 Open project: kerryjiang/SuperSocket

Protected Properties

Property Type Description
SyncRoot object

Private Properties

Property Type Description
AddStateFlag void
CheckState bool
FireCloseEvent void
GetCloseReasonFromState CloseReason
GetCloseReasonValue int
ISocketSession bool
InternalClose void
OnSendEnd void
OnSendEnd void
ProcessReceivedData System.ProcessResult
RemoveStateFlag void
Send void
StartSend void
TryAddStateFlag bool
ValidateClosed void
ValidateNotInSendingReceiving bool

Public Methods

Method Description
ApplySecureProtocol ( ) : void
Close ( CloseReason reason ) : void
GetUnderlyStream ( ) : Stream
Initialize ( IAppSession appSession ) : void
SocketSession ( Socket client ) : System
SocketSession ( string sessionID ) : System
Start ( ) : void

Starts this session.

TrySend ( ArraySegment segment ) : bool

Tries to send array segment.

TrySend ( IList segments ) : bool

Tries to send array segment.

Protected Methods

Method Description
IsIgnorableException ( Exception e, int &socketErrorCode ) : bool
IsIgnorableSocketError ( int socketErrorCode ) : bool
OnClosed ( CloseReason reason ) : void

Called when [close].

OnReceiveEnded ( ) : void
OnReceiveError ( CloseReason closeReason ) : void
OnReceiveStarted ( ) : void
OnSendError ( SendingQueue queue, CloseReason closeReason ) : void
OnSendingCompleted ( SendingQueue queue ) : void
SendAsync ( SendingQueue queue ) : void

Sends in async mode.

SendSync ( SendingQueue queue ) : void

Sends in sync mode.

StartSession ( ) : void

Says the welcome information when a client connectted.

TryValidateClosedBySocket ( Socket &socket ) : bool

Private Methods

Method Description
AddStateFlag ( int stateValue ) : void
CheckState ( int stateValue ) : bool
FireCloseEvent ( ) : void
GetCloseReasonFromState ( ) : CloseReason
GetCloseReasonValue ( CloseReason reason ) : int
ISocketSession ( ) : bool
InternalClose ( Socket client, CloseReason reason, bool setCloseReason ) : void
OnSendEnd ( ) : void
OnSendEnd ( bool isInClosingOrClosed ) : void
ProcessReceivedData ( ArraySegment data, IBufferState state ) : System.ProcessResult
RemoveStateFlag ( int stateValue ) : void
Send ( SendingQueue queue ) : void
StartSend ( SendingQueue queue, int sendingTrackID, bool initial ) : void
TryAddStateFlag ( int stateValue ) : bool
ValidateClosed ( CloseReason closeReason ) : void
ValidateNotInSendingReceiving ( ) : bool

Validates the socket is not in the sending or receiving operation.

Method Details

ApplySecureProtocol() public abstract method

public abstract ApplySecureProtocol ( ) : void
return void

Close() public method

public Close ( CloseReason reason ) : void
reason CloseReason
return void

GetUnderlyStream() public method

public GetUnderlyStream ( ) : Stream
return Stream

Initialize() public method

public Initialize ( IAppSession appSession ) : void
appSession IAppSession
return void

IsIgnorableException() protected method

protected IsIgnorableException ( Exception e, int &socketErrorCode ) : bool
e System.Exception
socketErrorCode int
return bool

IsIgnorableSocketError() protected method

protected IsIgnorableSocketError ( int socketErrorCode ) : bool
socketErrorCode int
return bool

OnClosed() protected method

Called when [close].
protected OnClosed ( CloseReason reason ) : void
reason CloseReason
return void

OnReceiveEnded() protected method

protected OnReceiveEnded ( ) : void
return void

OnReceiveError() protected method

protected OnReceiveError ( CloseReason closeReason ) : void
closeReason CloseReason
return void

OnReceiveStarted() protected method

protected OnReceiveStarted ( ) : void
return void

OnSendError() protected method

protected OnSendError ( SendingQueue queue, CloseReason closeReason ) : void
queue SendingQueue
closeReason CloseReason
return void

OnSendingCompleted() protected method

protected OnSendingCompleted ( SendingQueue queue ) : void
queue SendingQueue
return void

SendAsync() protected abstract method

Sends in async mode.
protected abstract SendAsync ( SendingQueue queue ) : void
queue SendingQueue The queue.
return void

SendSync() protected abstract method

Sends in sync mode.
protected abstract SendSync ( SendingQueue queue ) : void
queue SendingQueue The queue.
return void

SocketSession() public method

public SocketSession ( Socket client ) : System
client Socket
return System

SocketSession() public method

public SocketSession ( string sessionID ) : System
sessionID string
return System

Start() public abstract method

Starts this session.
public abstract Start ( ) : void
return void

StartSession() protected method

Says the welcome information when a client connectted.
protected StartSession ( ) : void
return void

TrySend() public method

Tries to send array segment.
public TrySend ( ArraySegment segment ) : bool
segment ArraySegment The segment.
return bool

TrySend() public method

Tries to send array segment.
public TrySend ( IList segments ) : bool
segments IList The segments.
return bool

TryValidateClosedBySocket() protected method

protected TryValidateClosedBySocket ( Socket &socket ) : bool
socket Socket
return bool

Property Details

SyncRoot protected_oe property

protected object SyncRoot
return object