C# Class MindTouch.Clacks.Server.AClientRequestHandler

Inheritance: IDisposable, IClientHandler
Show file Open project: MindTouch/MindTouch.Clacks

Protected Properties

Property Type Description
_buffer byte[]
_bufferDataLength int
_bufferPosition int
_carriageReturn bool
_commandBuffer StringBuilder
_commandCounter ulong
_endPoint System.Net.IPEndPoint
_socket Socket

Public Methods

Method Description
Dispose ( ) : void
ProcessRequests ( ) : void

Protected Methods

Method Description
AClientRequestHandler ( System.Guid clientId, Socket socket, IClacksInstrumentation instrumentation, Action removeCallback ) : System
CheckBufferTail ( int position, int length ) : void
CompleteRequest ( ) : void
EndCommandRequest ( string status ) : void
FailAndDispose ( string reason, Exception e ) : void
InitializeHandler ( string command ) : string
PrepareResponse ( string status ) : void
ProcessCommand ( ) : void

13/14. -> Calls StartCommandRequest

ProcessCommandData ( int position, int length ) : void
ProcessPayloadData ( int position, int length ) : void
Receive ( int>.Action continuation ) : void
SendResponse ( ) : void
StartCommandRequest ( ) : void

Private Methods

Method Description
CheckSocket ( ) : bool

Method Details

AClientRequestHandler() protected method

protected AClientRequestHandler ( System.Guid clientId, Socket socket, IClacksInstrumentation instrumentation, Action removeCallback ) : System
clientId System.Guid
socket Socket
instrumentation IClacksInstrumentation
removeCallback Action
return System

CheckBufferTail() protected method

protected CheckBufferTail ( int position, int length ) : void
position int
length int
return void

CompleteRequest() protected abstract method

protected abstract CompleteRequest ( ) : void
return void

Dispose() public method

public Dispose ( ) : void
return void

EndCommandRequest() protected method

protected EndCommandRequest ( string status ) : void
status string
return void

FailAndDispose() protected method

protected FailAndDispose ( string reason, Exception e ) : void
reason string
e System.Exception
return void

InitializeHandler() protected abstract method

protected abstract InitializeHandler ( string command ) : string
command string
return string

PrepareResponse() protected method

protected PrepareResponse ( string status ) : void
status string
return void

ProcessCommand() protected abstract method

13/14. -> Calls StartCommandRequest
protected abstract ProcessCommand ( ) : void
return void

ProcessCommandData() protected method

protected ProcessCommandData ( int position, int length ) : void
position int
length int
return void

ProcessPayloadData() protected method

protected ProcessPayloadData ( int position, int length ) : void
position int
length int
return void

ProcessRequests() public abstract method

public abstract ProcessRequests ( ) : void
return void

Receive() protected abstract method

protected abstract Receive ( int>.Action continuation ) : void
continuation int>.Action
return void

SendResponse() protected abstract method

protected abstract SendResponse ( ) : void
return void

StartCommandRequest() protected method

protected StartCommandRequest ( ) : void
return void

Property Details

_buffer protected property

protected byte[] _buffer
return byte[]

_bufferDataLength protected property

protected int _bufferDataLength
return int

_bufferPosition protected property

protected int _bufferPosition
return int

_carriageReturn protected property

protected bool _carriageReturn
return bool

_commandBuffer protected property

protected StringBuilder _commandBuffer
return StringBuilder

_commandCounter protected property

protected ulong _commandCounter
return ulong

_endPoint protected property

protected IPEndPoint,System.Net _endPoint
return System.Net.IPEndPoint

_socket protected property

protected Socket _socket
return Socket