dxFeed .Net API  5.13.0
dxFeed .Net API library intended to provide market data access for DX clients
Public Member Functions | Package Functions | Package Attributes | Properties | Events | Private Member Functions | Private Attributes
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 new connection More...
 
 NativeConnection (string address, Action< IDxConnection > disconnectListener, Action< IDxConnection, ConnectionStatus, ConnectionStatus > connectionStatusListener)
 Creates new connection More...
 
 NativeConnection (string address, System.Net.NetworkCredential credential, Action< IDxConnection > disconnectListener, Action< IDxConnection, ConnectionStatus, ConnectionStatus > connectionStatusListener)
 Creates new connection. More...
 
 NativeConnection (string address, string token, Action< IDxConnection > disconnectListener)
 Creates new connection. More...
 
 NativeConnection (string address, string token, Action< IDxConnection > disconnectListener, Action< IDxConnection, ConnectionStatus, ConnectionStatus > connectionStatusListener)
 Creates new connection. More...
 
 NativeConnection (string address, string authscheme, string authdata, Action< IDxConnection > disconnectListener, Action< IDxConnection, ConnectionStatus, ConnectionStatus > connectionStatusListener)
 Creates new connection. More...
 
void Disconnect ()
 Disconnect from the server More...
 
IDxSubscription CreateSubscription (EventType type, EventSubscriptionFlag eventSubscriptionFlags, IDxEventListener listener)
 Create event subscription. More...
 
IDxSubscription CreateSubscription (EventType type, IDxEventListener listener)
 Create event subscription. More...
 
IDxSubscription CreateSubscription (DateTime? time, EventSubscriptionFlag eventSubscriptionFlags, IDxCandleListener listener)
 Create candle event subscription. More...
 
IDxSubscription CreateSubscription (DateTime? time, IDxCandleListener listener)
 Create candle event subscription. More...
 
IDxSubscription CreateSubscription (EventType type, long time, EventSubscriptionFlag eventSubscriptionFlags, IDxEventListener listener)
 Create time event subscription. More...
 
IDxSubscription CreateSubscription (EventType type, long time, IDxEventListener listener)
 Create time event subscription. More...
 
IDxSubscription CreateSubscription (EventType type, DateTime? time, EventSubscriptionFlag eventSubscriptionFlags, IDxEventListener listener)
 Create time event subscription. More...
 
IDxSubscription CreateSubscription (EventType type, DateTime? time, IDxEventListener listener)
 Create time event subscription. More...
 
IDxSubscription CreateSnapshotSubscription (Int64 time, IDxSnapshotListener listener)
 Creates snapshot subscription More...
 
IDxSubscription CreateSnapshotSubscription (DateTime? time, IDxSnapshotListener listener)
 Creates snapshot subscription More...
 
IDxSubscription CreateSnapshotSubscription (EventType eventType, Int64 time, IDxSnapshotListener listener)
 Creates snapshot subscription More...
 
IDxSubscription CreateSnapshotSubscription (EventType eventType, DateTime? time, IDxSnapshotListener listener)
 Creates snapshot subscription More...
 
IDxSubscription CreateOrderViewSubscription (IDxOrderViewListener listener)
 Creates Order View subscription More...
 
IDxRegionalBook CreateRegionalBook (string symbol, IDxRegionalBookListener book_listener, IDxQuoteListener quote_listener)
 Creates regional book More...
 
void WriteRawData (string rawFileName)
 Add dumping raw data of incoming traffic of connection into specific file More...
 
void Dispose ()
 

Package Functions

void RemoveSubscription (IDxSubscription subscription)
 

Package Attributes

IntPtr Handler => handler
 

Properties

IDictionary< string, string > Properties [get]
 
string ConnectedAddress [get]
 
ConnectionStatus Status [get]
 
- 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
 

Private Member Functions

void OnDisconnect (IntPtr connection, IntPtr userData)
 
void ConnectionStatusChangeHandler (IntPtr connection, ConnectionStatus oldStatus, ConnectionStatus newStatus, IntPtr userData)
 
int OnNativeCreate (IntPtr connection, IntPtr userData)
 

Private Attributes

IntPtr handler = IntPtr.Zero
 
readonly C.dxf_conn_termination_notifier_t termination_notifier
 
readonly C.dxf_conn_status_notifier_t connectionStatusChangeHandler
 
readonly C.dxf_socket_thread_creation_notifier_t creationNotifier
 
readonly Action< IDxConnectiondisconnectListener
 
readonly Action< IDxConnection, ConnectionStatus, ConnectionStatusconnectionStatusListener
 
readonly ISet< IDxSubscriptionsubscriptions = new HashSet<IDxSubscription>()
 

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 new connection

Parameters
addressserver address to connect
disconnectListenerlistener 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 new connection

Parameters
addressserver address to connect
disconnectListenerlistener will be called when the connection is interrupted
connectionStatusListenerlistener 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 new connection.

Parameters
addressServer address to connect.
credentialUser name and password to server access.
disconnectListenerListener will be called when the connection is interrupted.
connectionStatusListenerlistener will be called when the connection status is changed
Exceptions
DxExceptionCreate connection failed.

◆ NativeConnection() [4/6]

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

Creates new connection.

Parameters
addressServer address to connect.
tokenBearer scheme token to server access.
disconnectListenerListener will be called when the connection is interrupted.
Exceptions
DxExceptionCreate connection failed.

◆ NativeConnection() [5/6]

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

Creates new connection.

Parameters
addressServer address to connect.
tokenBearer scheme token to server access.
disconnectListenerListener will be called when the connection is interrupted.
connectionStatusListenerlistener will be called when the connection status is changed
Exceptions
DxExceptionCreate connection 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 new connection.

Parameters
addressServer address to connect.
authschemeThe authorization scheme.
authdataThe authorization data.
disconnectListenerListener will be called when the connection is interrupted.
connectionStatusListenerlistener will be called when the connection status is changed
Exceptions
DxExceptionCreate connection failed.

Member Function Documentation

◆ ConnectionStatusChangeHandler()

void com.dxfeed.native.NativeConnection.ConnectionStatusChangeHandler ( IntPtr  connection,
ConnectionStatus  oldStatus,
ConnectionStatus  newStatus,
IntPtr  userData 
)
inlineprivate

◆ CreateOrderViewSubscription()

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

Creates Order View subscription

Parameters
listener
Returns
subscription object
Exceptions
DxException

Implements com.dxfeed.api.IDxConnection.

◆ CreateRegionalBook()

IDxRegionalBook com.dxfeed.native.NativeConnection.CreateRegionalBook ( string  symbol,
IDxRegionalBookListener  book_listener,
IDxQuoteListener  quote_listener 
)
inline

Creates regional book

Parameters
symbolSingle symbol name
book_listenerRegional book changes listener. Null is allowed.
quote_listenerQuotes listener. Null is allowed.
Returns
regional book object

Implements com.dxfeed.api.IDxConnection.

◆ CreateSnapshotSubscription() [1/4]

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

Creates snapshot subscription

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

Implements com.dxfeed.api.IDxConnection.

◆ CreateSnapshotSubscription() [2/4]

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

Creates snapshot subscription

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,
Int64  time,
IDxSnapshotListener  listener 
)
inline

Creates snapshot subscription

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

Implements com.dxfeed.api.IDxConnection.

◆ CreateSnapshotSubscription() [4/4]

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

Creates snapshot subscription

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

Create event subscription.

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

Create event subscription.

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

Create candle event subscription.

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

Create candle event subscription.

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

Create time event subscription.

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

Create time event subscription.

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

Create time event subscription.

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

Create time event subscription.

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

Exceptions
DxException

Implements com.dxfeed.api.IDxConnection.

◆ Dispose()

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

◆ OnCreationEventHandler()

delegate void com.dxfeed.native.NativeConnection.OnCreationEventHandler ( object  sender,
EventArgs  e 
)

◆ OnDisconnect()

void com.dxfeed.native.NativeConnection.OnDisconnect ( IntPtr  connection,
IntPtr  userData 
)
inlineprivate

◆ OnNativeCreate()

int com.dxfeed.native.NativeConnection.OnNativeCreate ( IntPtr  connection,
IntPtr  userData 
)
inlineprivate

◆ RemoveSubscription()

void com.dxfeed.native.NativeConnection.RemoveSubscription ( IDxSubscription  subscription)
inlinepackage

◆ WriteRawData()

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

Add dumping raw data of incoming traffic of connection into specific file

Parameters
rawFileNamefile name for raw data
Exceptions
ArgumentExceptionInvalid argument rawFileName
NativeDxException

Implements com.dxfeed.api.IDxConnection.

Field Documentation

◆ connectionStatusChangeHandler

readonly C.dxf_conn_status_notifier_t com.dxfeed.native.NativeConnection.connectionStatusChangeHandler
private

◆ connectionStatusListener

readonly Action<IDxConnection, ConnectionStatus, ConnectionStatus> com.dxfeed.native.NativeConnection.connectionStatusListener
private

◆ creationNotifier

readonly C.dxf_socket_thread_creation_notifier_t com.dxfeed.native.NativeConnection.creationNotifier
private

◆ disconnectListener

readonly Action<IDxConnection> com.dxfeed.native.NativeConnection.disconnectListener
private

◆ handler

IntPtr com.dxfeed.native.NativeConnection.handler = IntPtr.Zero
private

◆ Handler

IntPtr com.dxfeed.native.NativeConnection.Handler => handler
package

◆ subscriptions

readonly ISet<IDxSubscription> com.dxfeed.native.NativeConnection.subscriptions = new HashSet<IDxSubscription>()
private

◆ termination_notifier

readonly C.dxf_conn_termination_notifier_t com.dxfeed.native.NativeConnection.termination_notifier
private

Property Documentation

◆ ConnectedAddress

string com.dxfeed.native.NativeConnection.ConnectedAddress
get

◆ Properties

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

◆ Status

ConnectionStatus com.dxfeed.native.NativeConnection.Status
get

Event Documentation

◆ OnCreation

OnCreationEventHandler com.dxfeed.native.NativeConnection.OnCreation

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