dxFeed .Net API  7.1.0
dxFeed .Net API library intended to provide market data access for DX clients
com.dxfeed.native.NativeConnection Class Reference

Class provides operations with event subscription More...

Inheritance diagram for com.dxfeed.native.NativeConnection:
[legend]
Collaboration diagram for com.dxfeed.native.NativeConnection:
[legend]

Public Member Functions

delegate void OnCreationEventHandler (object sender, EventArgs e)
 
 NativeConnection (string address, Action< IDxConnection > disconnectListener)
 Creates the new connection More...
 
 NativeConnection (string address, Action< IDxConnection > disconnectListener, Action< IDxConnection, ConnectionStatus, ConnectionStatus > connectionStatusListener)
 Creates the new connection More...
 
 NativeConnection (string address, System.Net.NetworkCredential credential, Action< IDxConnection > disconnectListener, Action< IDxConnection, ConnectionStatus, ConnectionStatus > connectionStatusListener)
 Creates the new connection. More...
 
 NativeConnection (string address, string token, Action< IDxConnection > disconnectListener)
 Creates the new connection. More...
 
 NativeConnection (string address, string token, Action< IDxConnection > disconnectListener, Action< IDxConnection, ConnectionStatus, ConnectionStatus > connectionStatusListener)
 Creates the new connection. More...
 
 NativeConnection (string address, string authScheme, string authData, Action< IDxConnection > disconnectListener, Action< IDxConnection, ConnectionStatus, ConnectionStatus > connectionStatusListener)
 Creates the new connection. More...
 
void SetOnServerHeartbeatHandler (OnServerHeartbeatHandler handler)
 Sets a handler that will be called when a server heartbeat arrives and contains non empty payload More...
 
void Disconnect ()
 Disconnect from the server More...
 
IDxSubscription CreateSubscription (EventType type, EventSubscriptionFlag eventSubscriptionFlags, IDxEventListener listener)
 Creates an event subscription. More...
 
IDxSubscription CreateSubscription (EventType type, IDxEventListener listener)
 Creates an event subscription. More...
 
IDxSubscription CreateSubscription (DateTime? time, EventSubscriptionFlag eventSubscriptionFlags, IDxCandleListener listener)
 Creates a candle event subscription. More...
 
IDxSubscription CreateSubscription (DateTime? time, IDxCandleListener listener)
 Creates a candle event subscription. More...
 
IDxSubscription CreateSubscription (EventType type, long time, EventSubscriptionFlag eventSubscriptionFlags, IDxEventListener listener)
 Creates a time event subscription. More...
 
IDxSubscription CreateSubscription (EventType type, long time, IDxEventListener listener)
 Creates a time event subscription. More...
 
IDxSubscription CreateSubscription (EventType type, DateTime? time, EventSubscriptionFlag eventSubscriptionFlags, IDxEventListener listener)
 Creates a time event subscription. More...
 
IDxSubscription CreateSubscription (EventType type, DateTime? time, IDxEventListener listener)
 Creates a time event subscription. More...
 
IDxSubscription CreateSnapshotSubscription (long time, IDxSnapshotListener listener)
 Creates a snapshot subscription More...
 
IDxSubscription CreateSnapshotSubscription (DateTime? time, IDxSnapshotListener listener)
 Creates a snapshot subscription More...
 
IDxSubscription CreateSnapshotSubscription (EventType eventType, long time, IDxSnapshotListener listener)
 Creates a snapshot subscription More...
 
IDxSubscription CreateSnapshotSubscription (EventType eventType, DateTime? time, IDxSnapshotListener listener)
 Creates a snapshot subscription More...
 
IDxSubscription CreateOrderViewSubscription (IDxOrderViewListener listener)
 Creates an Order View subscription More...
 
IDxRegionalBook CreateRegionalBook (string symbol, IDxRegionalBookListener bookListener, IDxQuoteListener quoteListener)
 Creates a regional book More...
 
void WriteRawData (string rawFileName)
 Enables the dumping raw data of incoming traffic of connection into specific file More...
 
void Dispose ()
 Disposes the connection object More...
 
- Public Member Functions inherited from com.dxfeed.api.IDxConnection
IDxSubscription CreateSnapshotSubscription (Int64 time, IDxSnapshotListener listener)
 Creates snapshot subscription More...
 
IDxSubscription CreateSnapshotSubscription (EventType eventType, Int64 time, IDxSnapshotListener listener)
 Creates snapshot subscription More...
 

Properties

IDictionary< string, string > Properties [get]
 Returns the current connection properties More...
 
string ConnectedAddress [get]
 Returns the current connection address More...
 
ConnectionStatus Status [get]
 Returns the current connection status More...
 
- Properties inherited from com.dxfeed.api.IDxConnection
IDictionary< string, string > Properties [get]
 Retrieves properties for specified connection. Properties can be changed during reconnection. So returned array is a snapshot of properties at the moment of the call. More...
 
string ConnectedAddress [get]
 Retrieves string with current connected address in format <host>:<port>. If return value is NULL then connection is not connected (reconnection, no valid addresses, closed connection and others). More...
 
ConnectionStatus Status [get]
 Retrieves the current connection status More...
 

Events

OnCreationEventHandler OnCreation
 

Detailed Description

Class provides operations with event subscription

Constructor & Destructor Documentation

◆ NativeConnection() [1/6]

com.dxfeed.native.NativeConnection.NativeConnection ( string  address,
Action< IDxConnection disconnectListener 
)
inline

Creates the new connection

Don't call this constructor inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

Parameters
addressThe server address to connect
disconnectListenerThe listener that will be called when the connection is interrupted
Exceptions
DxException

◆ NativeConnection() [2/6]

com.dxfeed.native.NativeConnection.NativeConnection ( string  address,
Action< IDxConnection disconnectListener,
Action< IDxConnection, ConnectionStatus, ConnectionStatus >  connectionStatusListener 
)
inline

Creates the new connection

Don't call this constructor inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

Parameters
addressThe server address to connect
disconnectListenerThe listener that will be called when the connection is interrupted
connectionStatusListenerThe listener that will be called when the connection status is changed
Exceptions
DxException

◆ NativeConnection() [3/6]

com.dxfeed.native.NativeConnection.NativeConnection ( string  address,
System.Net.NetworkCredential  credential,
Action< IDxConnection disconnectListener,
Action< IDxConnection, ConnectionStatus, ConnectionStatus >  connectionStatusListener 
)
inline

Creates the new connection.

Don't call this constructor inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

Parameters
addressThe server address to connect.
credentialThe user name and password to server access.
disconnectListenerThe listener that will be called when the connection is interrupted.
connectionStatusListenerThe listener that will be called when the connection status is changed
Exceptions
DxExceptionThe connection creation was failed.

◆ NativeConnection() [4/6]

com.dxfeed.native.NativeConnection.NativeConnection ( string  address,
string  token,
Action< IDxConnection disconnectListener 
)
inline

Creates the new connection.

Don't call this constructor inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

Parameters
addressThe Server address to connect.
tokenBearer scheme token to server access.
disconnectListenerThe listener that will be called when the connection is interrupted.
Exceptions
DxExceptionThe connection creation was failed.

◆ NativeConnection() [5/6]

com.dxfeed.native.NativeConnection.NativeConnection ( string  address,
string  token,
Action< IDxConnection disconnectListener,
Action< IDxConnection, ConnectionStatus, ConnectionStatus >  connectionStatusListener 
)
inline

Creates the new connection.

Don't call this constructor inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

Parameters
addressServer address to connect.
tokenBearer scheme token to server access.
disconnectListenerThe listener that will be called when the connection is interrupted.
connectionStatusListenerThe listener that will be called when the connection status is changed
Exceptions
DxExceptionThe connection creation was failed.

◆ NativeConnection() [6/6]

com.dxfeed.native.NativeConnection.NativeConnection ( string  address,
string  authScheme,
string  authData,
Action< IDxConnection disconnectListener,
Action< IDxConnection, ConnectionStatus, ConnectionStatus >  connectionStatusListener 
)
inline

Creates the new connection.

Don't call this constructor inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

Parameters
addressThe server address to connect.
authSchemeThe authorization scheme.
authDataThe authorization data.
disconnectListenerThe listener that will be called when the connection is interrupted.
connectionStatusListenerThe listener that will be called when the connection status is changed
Exceptions
DxExceptionThe connection creation was failed.

Member Function Documentation

◆ CreateOrderViewSubscription()

IDxSubscription com.dxfeed.native.NativeConnection.CreateOrderViewSubscription ( IDxOrderViewListener  listener)
inline

Creates an Order View subscription

Don't call this method inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

Parameters
listener
Returns
subscription object
Exceptions
DxException

Implements com.dxfeed.api.IDxConnection.

◆ CreateRegionalBook()

IDxRegionalBook com.dxfeed.native.NativeConnection.CreateRegionalBook ( string  symbol,
IDxRegionalBookListener  bookListener,
IDxQuoteListener  quoteListener 
)
inline

Creates a regional book

Don't call this method inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

Parameters
symbolSingle symbol name
bookListenerRegional book changes listener. Null is allowed.
quoteListenerQuotes listener. Null is allowed.
Returns
regional book object

Implements com.dxfeed.api.IDxConnection.

◆ CreateSnapshotSubscription() [1/4]

IDxSubscription com.dxfeed.native.NativeConnection.CreateSnapshotSubscription ( long  time,
IDxSnapshotListener  listener 
)
inline

Creates a snapshot subscription

Don't call this method inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

Parameters
timeTime in the past - number of milliseconds from 1.1.1970 (unix time)
listenersnapshot listener callback
Returns
subscription object
Exceptions
DxException

◆ CreateSnapshotSubscription() [2/4]

IDxSubscription com.dxfeed.native.NativeConnection.CreateSnapshotSubscription ( DateTime?  time,
IDxSnapshotListener  listener 
)
inline

Creates a snapshot subscription

Don't call this method inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

Parameters
timeDate time in the past
listenersnapshot listener callback
Returns
subscription object
Exceptions
DxException

Implements com.dxfeed.api.IDxConnection.

◆ CreateSnapshotSubscription() [3/4]

IDxSubscription com.dxfeed.native.NativeConnection.CreateSnapshotSubscription ( EventType  eventType,
long  time,
IDxSnapshotListener  listener 
)
inline

Creates a snapshot subscription

Don't call this method inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

Parameters
eventTypeSingle event type.
timeTime in the past - number of milliseconds from 1.1.1970 (unix time)
listenersnapshot listener callback
Returns
subscription object
Exceptions
DxException

◆ CreateSnapshotSubscription() [4/4]

IDxSubscription com.dxfeed.native.NativeConnection.CreateSnapshotSubscription ( EventType  eventType,
DateTime?  time,
IDxSnapshotListener  listener 
)
inline

Creates a snapshot subscription

Don't call this method inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

Parameters
eventTypeSingle event type.
timeDate time in the past
listenersnapshot listener callback
Returns
subscription object
Exceptions
DxException

Implements com.dxfeed.api.IDxConnection.

◆ CreateSubscription() [1/8]

IDxSubscription com.dxfeed.native.NativeConnection.CreateSubscription ( EventType  type,
EventSubscriptionFlag  eventSubscriptionFlags,
IDxEventListener  listener 
)
inline

Creates an event subscription.

Don't call this method inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

Parameters
typeEvent type.
eventSubscriptionFlagsEvent subscription flags
listenerEvent listener callback.
Returns
Subscription object.
Exceptions
ArgumentNullExceptionListener is null.
DxException

◆ CreateSubscription() [2/8]

IDxSubscription com.dxfeed.native.NativeConnection.CreateSubscription ( EventType  type,
IDxEventListener  listener 
)
inline

Creates an event subscription.

Don't call this method inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

Parameters
typeEvent type.
listenerEvent listener callback.
Returns
Subscription object.
Exceptions
ArgumentNullExceptionListener is null.
DxException

Implements com.dxfeed.api.IDxConnection.

◆ CreateSubscription() [3/8]

IDxSubscription com.dxfeed.native.NativeConnection.CreateSubscription ( DateTime?  time,
EventSubscriptionFlag  eventSubscriptionFlags,
IDxCandleListener  listener 
)
inline

Creates a candle event subscription.

Don't call this method inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

Parameters
timeDate time in the past.
eventSubscriptionFlagsEvent subscription flags
listenerCandle listener callback.
Returns
Subscription object.
Exceptions
ArgumentNullExceptionListener is null.
DxException

◆ CreateSubscription() [4/8]

IDxSubscription com.dxfeed.native.NativeConnection.CreateSubscription ( DateTime?  time,
IDxCandleListener  listener 
)
inline

Creates a candle event subscription.

Don't call this method inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

Parameters
timeDate time in the past.
listenerCandle listener callback.
Returns
Subscription object.
Exceptions
ArgumentNullExceptionListener is null.
DxException

Implements com.dxfeed.api.IDxConnection.

◆ CreateSubscription() [5/8]

IDxSubscription com.dxfeed.native.NativeConnection.CreateSubscription ( EventType  type,
long  time,
EventSubscriptionFlag  eventSubscriptionFlags,
IDxEventListener  listener 
)
inline

Creates a time event subscription.

Don't call this method inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

Parameters
typeEvent type.
timeUnix time stamp (the number of milliseconds from 1.1.1970)
eventSubscriptionFlagsEvent subscription flags
listenerEvent listener callback.
Returns
Subscription object.
Exceptions
ArgumentNullExceptionListener is null.
DxException

◆ CreateSubscription() [6/8]

IDxSubscription com.dxfeed.native.NativeConnection.CreateSubscription ( EventType  type,
long  time,
IDxEventListener  listener 
)
inline

Creates a time event subscription.

Don't call this method inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

Parameters
typeEvent type.
timeUnix time stamp (the number of milliseconds from 1.1.1970)
listenerEvent listener callback.
Returns
Subscription object.
Exceptions
ArgumentNullExceptionListener is null.
DxException

Implements com.dxfeed.api.IDxConnection.

◆ CreateSubscription() [7/8]

IDxSubscription com.dxfeed.native.NativeConnection.CreateSubscription ( EventType  type,
DateTime?  time,
EventSubscriptionFlag  eventSubscriptionFlags,
IDxEventListener  listener 
)
inline

Creates a time event subscription.

Don't call this method inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

Parameters
typeEvent type.
timeDate time in the past.
eventSubscriptionFlagsEvent subscription flags
listenerEvent listener callback.
Returns
Subscription object.
Exceptions
ArgumentNullExceptionListener is null.
DxException

◆ CreateSubscription() [8/8]

IDxSubscription com.dxfeed.native.NativeConnection.CreateSubscription ( EventType  type,
DateTime?  time,
IDxEventListener  listener 
)
inline

Creates a time event subscription.

Don't call this method inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

Parameters
typeEvent type.
timeDate time in the past.
listenerEvent listener callback.
Returns
Subscription object.
Exceptions
ArgumentNullExceptionListener is null.
DxException

Implements com.dxfeed.api.IDxConnection.

◆ Disconnect()

void com.dxfeed.native.NativeConnection.Disconnect ( )
inline

Disconnect from the server

Don't call this method inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

Exceptions
DxException

Implements com.dxfeed.api.IDxConnection.

◆ Dispose()

void com.dxfeed.native.NativeConnection.Dispose ( )
inline

Disposes the connection object

Clears the subscriptions and disconnects

Don't call this method inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

◆ SetOnServerHeartbeatHandler()

void com.dxfeed.native.NativeConnection.SetOnServerHeartbeatHandler ( OnServerHeartbeatHandler  handler)
inline

Sets a handler that will be called when a server heartbeat arrives and contains non empty payload

Example:

connection.SetOnServerHeartbeatHandler((connection, time, lagMark, rtt) => {
Console.Error.WriteLine($"##### Server time (UTC) = {time}, Server lag = {lagMark} us, RTT = {rtt} us #####");
});

Don't call this method inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

Parameters
handlerThe handler that will be called

◆ WriteRawData()

void com.dxfeed.native.NativeConnection.WriteRawData ( string  rawFileName)
inline

Enables the dumping raw data of incoming traffic of connection into specific file

Don't call this method inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

Parameters
rawFileNamefile name for raw data
Exceptions
ArgumentExceptionInvalid argument rawFileName
NativeDxException

Implements com.dxfeed.api.IDxConnection.

Property Documentation

◆ ConnectedAddress

string com.dxfeed.native.NativeConnection.ConnectedAddress
get

Returns the current connection address

Don't use this property inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

◆ Properties

IDictionary<string, string> com.dxfeed.native.NativeConnection.Properties
get

Returns the current connection properties

Don't call this method inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes

◆ Status

ConnectionStatus com.dxfeed.native.NativeConnection.Status
get

Returns the current connection status

Don't use this property inside any listeners and callbacks of NativeSubscription, NativeConnection, NativeRegionalBook, NativeSnapshotSubscription classes


The documentation for this class was generated from the following file: