C# Class CqlSharp.Network.Connection

A single connection to a Cassandra node.
显示文件 Open project: reuzel/CqlSharp Class Usage Examples

Private Properties

Property Type Description
AuthenticateAsync Task
Close void
ConnectAsync Task
Disconnect void
NegotiateConnectionOptionsAsync Task
OpenAsyncInternal Task
ProcessEvent void
ReadFramesAsync void
SendRequestAsyncComplex Task
SendRequestAsyncInternal Task
StartupAsync Task
UpdateLoad void

Public Methods

Method Description
Connection ( Node node, int nr ) : System

Initializes a new instance of the Connection class.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

OpenAsync ( Logger logger ) : Task

Opens the connection. The actual open sequence will be executed at most once.

RegisterForClusterChangesAsync ( Logger logger ) : Task

Registers for cluster changes.

SendRequestAsync ( Frame frame, Logger logger, int load, CancellationToken token ) : Task

Submits a frame, and waits until response is received

ToString ( ) : string

Returns a System.String that represents this instance.

Private Methods

Method Description
AuthenticateAsync ( AuthenticateFrame auth, Logger logger ) : Task

Authenticates the connection.

Close ( bool failed ) : void

Closes this connection and moves it into closed state

ConnectAsync ( ) : Task

Creates an underlying TCP connection

Disconnect ( ) : void

Closes the TCP connection underlying this connection if any

NegotiateConnectionOptionsAsync ( Logger logger ) : Task

Negotiates the connection options.

OpenAsyncInternal ( Logger logger ) : Task

Opens the connection. Called once per connection only

ProcessEvent ( EventFrame frame ) : void

Processes the event frame.

ReadFramesAsync ( ) : void

Starts a readloop

SendRequestAsyncComplex ( Frame frame, Logger logger, int load, CancellationToken token ) : Task

Submits a frame, and waits until response is received (complex version)

SendRequestAsyncInternal ( Frame frame, Logger logger, int load, CancellationToken token ) : Task

Sends the request async internal. Cancellation supported until request is send, after which answer must be handled to avoid connection corruption.

StartupAsync ( Logger logger ) : Task

Startups the connection using the required message exchange

UpdateLoad ( int load, Logger logger ) : void

Updates the load of this connection, and will trigger a corresponding event

Method Details

Connection() public method

Initializes a new instance of the Connection class.
public Connection ( Node node, int nr ) : System
node Node The node.
nr int The connection nr.
return System

Dispose() public method

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
return void

OpenAsync() public method

Opens the connection. The actual open sequence will be executed at most once.
public OpenAsync ( Logger logger ) : Task
logger Logger
return Task

RegisterForClusterChangesAsync() public method

Registers for cluster changes.
Must be connected before Registration can take place Could not register for cluster changes!
public RegisterForClusterChangesAsync ( Logger logger ) : Task
logger Logger
return Task

SendRequestAsync() public method

Submits a frame, and waits until response is received
public SendRequestAsync ( Frame frame, Logger logger, int load, CancellationToken token ) : Task
frame CqlSharp.Protocol.Frame The frame to send.
logger Logger logger to write progress to
load int the load indication of the request. Used for balancing queries over nodes and connections
token System.Threading.CancellationToken The token.
return Task

ToString() public method

Returns a System.String that represents this instance.
public ToString ( ) : string
return string