C# Класс CqlSharp.Network.Connection

A single connection to a Cassandra node.
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
AuthenticateAsync Task
Close void
ConnectAsync Task
Disconnect void
NegotiateConnectionOptionsAsync Task
OpenAsyncInternal Task
ProcessEvent void
ReadFramesAsync void
SendRequestAsyncComplex Task
SendRequestAsyncInternal Task
StartupAsync Task
UpdateLoad void

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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

Описание методов

Connection() публичный Метод

Initializes a new instance of the Connection class.
public Connection ( Node node, int nr ) : System
node Node The node.
nr int The connection nr.
Результат System

Dispose() публичный Метод

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Результат void

OpenAsync() публичный Метод

Opens the connection. The actual open sequence will be executed at most once.
public OpenAsync ( Logger logger ) : Task
logger Logger
Результат Task

RegisterForClusterChangesAsync() публичный Метод

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
Результат Task

SendRequestAsync() публичный Метод

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.
Результат Task

ToString() публичный Метод

Returns a System.String that represents this instance.
public ToString ( ) : string
Результат string