dxFeed .Net API  5.8.0
dxFeed .Net API library intended to provide market data access for DX clients
Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | Events | Private Member Functions | Private Attributes | Static Private Attributes
com.dxfeed.api.DXEndpoint Class Reference

Manages network connections to DXFeed. More...

Inheritance diagram for com.dxfeed.api.DXEndpoint:
[legend]
Collaboration diagram for com.dxfeed.api.DXEndpoint:
[legend]

Public Member Functions

IDXEndpoint User (string user)
 Changes user name for this endpoint. This method shall be called before Connect(string) together with Password(string) to configure service access credentials. More...
 
IDXEndpoint Password (string password)
 Changes password for this endpoint. This method shall be called before Connect(string) together with User(string) to configure service access credentials. More...
 
IDXEndpoint Connect (string address)
 
void Disconnect ()
 
void Close ()
 
ISet< Type > GetEventTypes ()
 Returns a set of all event types supported by this endpoint. The resulting set cannot be modified. More...
 
void Dispose ()
 

Static Public Member Functions

static IDXEndpoint GetInstance ()
 Returns a default application-wide singleton instance of DXEndpoint with a default role. Most applications use only a single data-source and should rely on this method to get one. More...
 
static IDXEndpoint Create ()
 Creates an new endpoint. More...
 

Protected Member Functions

 DXEndpoint ()
 Protected constructor for implementations of DXEndpoint. More...
 

Properties

DXEndpointState State [get, private set]
 Thread-safe state getter of this endpoint. More...
 
IDXFeed Feed [get, private set]
 Returns feed that is associated with this endpoint. More...
 
IDxConnection Connection [get]
 
- Properties inherited from com.dxfeed.api.IDXEndpoint
DXEndpointState State [get]
 Thread-safe state getter of this endpoint. More...
 
IDXFeed Feed [get]
 Returns feed that is associated with this endpoint. More...
 

Events

OnEndpointClosingEventHandler OnClosing
 Event fires when Close() method was called. More...
 
- Events inherited from com.dxfeed.api.IDXEndpoint
OnEndpointClosingEventHandler OnClosing
 Event fires when Close() method was called. More...
 

Private Member Functions

void ConnectionInstance_OnCreation (object sender, EventArgs e)
 
void UnsafeCloseConnection ()
 

Private Attributes

object stateLocker = new object()
 
DXEndpointState assyncState = DXEndpointState.NotConnected
 
string address = DefaultAddress
 
string user = DefaultUser
 
string password = DefaultPassword
 
NativeConnection connection = null
 

Static Private Attributes

static readonly string DefaultAddress = "demo.dxfeed.com:7300"
 
static readonly string DefaultUser = "demo"
 
static readonly string DefaultPassword = "demo"
 
static DXEndpoint endpointInstance = null
 
static object instanceLocker = new object()
 

Detailed Description

Manages network connections to DXFeed.

Constructor & Destructor Documentation

◆ DXEndpoint()

com.dxfeed.api.DXEndpoint.DXEndpoint ( )
inlineprotected

Protected constructor for implementations of DXEndpoint.

Member Function Documentation

◆ Close()

void com.dxfeed.api.DXEndpoint.Close ( )
inline

Closes this endpoint. All network connection are terminated as with Disconnect() method and no further connections can be established.

The endpoint State immediately becomes DXEndpointState.Closed. All resources associated with this endpoint are released.

Implements com.dxfeed.api.IDXEndpoint.

◆ Connect()

IDXEndpoint com.dxfeed.api.DXEndpoint.Connect ( string  address)
inline

Connects to the specified remove address. Previously established connections are closed if the new address is different from the old one. This method does nothing if address does not change or if this endpoint is DXEndpointState.Closed. The endpoint State immediately becomes DXEndpointState.Connecting otherwise.

The address string is provided with the market data vendor agreement. Use "demo.dxfeed.com:7300" for a demo quote feed.

The simplest address strings have the following format:
host:port to establish a TCP/IP connection
:port to listen for a TCP/IP connection with a plain socket connector (good for up to a few hundred of connections).

For premium services access credentials must be configured before invocation of Connect method using User(string) and Password(string) methods.

Parameters
addressThe data source address.
Returns
This DXEndpoint.
Exceptions
ArgumentNullExceptionIf address is null.

Implements com.dxfeed.api.IDXEndpoint.

◆ ConnectionInstance_OnCreation()

void com.dxfeed.api.DXEndpoint.ConnectionInstance_OnCreation ( object  sender,
EventArgs  e 
)
inlineprivate

◆ Create()

static IDXEndpoint com.dxfeed.api.DXEndpoint.Create ( )
inlinestatic

Creates an new endpoint.

Returns
The created endpoint.

◆ Disconnect()

void com.dxfeed.api.DXEndpoint.Disconnect ( )
inline

Terminates all remote network connections. This method does nothing if this endpoint is DXEndpointState.Closed. The endpoint State immediately becomes DXEndpointState.NotConnected otherwise.

This method does not release all resources that are associated with this endpoint. Use Close() method to release all resources.

Implements com.dxfeed.api.IDXEndpoint.

◆ Dispose()

void com.dxfeed.api.DXEndpoint.Dispose ( )
inline

◆ GetEventTypes()

ISet<Type> com.dxfeed.api.DXEndpoint.GetEventTypes ( )
inline

Returns a set of all event types supported by this endpoint. The resulting set cannot be modified.

Returns
Set of all event types.

Implements com.dxfeed.api.IDXEndpoint.

◆ GetInstance()

static IDXEndpoint com.dxfeed.api.DXEndpoint.GetInstance ( )
inlinestatic

Returns a default application-wide singleton instance of DXEndpoint with a default role. Most applications use only a single data-source and should rely on this method to get one.

Returns
Instance of DXEndpoint with a default role.

◆ Password()

IDXEndpoint com.dxfeed.api.DXEndpoint.Password ( string  password)
inline

Changes password for this endpoint. This method shall be called before Connect(string) together with User(string) to configure service access credentials.

Parameters
passwordPassword
Returns
This DXEndpoint.
Exceptions
ArgumentNullExceptionIf password is null.

Implements com.dxfeed.api.IDXEndpoint.

◆ UnsafeCloseConnection()

void com.dxfeed.api.DXEndpoint.UnsafeCloseConnection ( )
inlineprivate

◆ User()

IDXEndpoint com.dxfeed.api.DXEndpoint.User ( string  user)
inline

Changes user name for this endpoint. This method shall be called before Connect(string) together with Password(string) to configure service access credentials.

Parameters
userUser name.
Returns
This DXEndpoint.
Exceptions
ArgumentNullExceptionIf user is null.

Implements com.dxfeed.api.IDXEndpoint.

Field Documentation

◆ address

string com.dxfeed.api.DXEndpoint.address = DefaultAddress
private

◆ assyncState

DXEndpointState com.dxfeed.api.DXEndpoint.assyncState = DXEndpointState.NotConnected
private

◆ connection

NativeConnection com.dxfeed.api.DXEndpoint.connection = null
private

◆ DefaultAddress

readonly string com.dxfeed.api.DXEndpoint.DefaultAddress = "demo.dxfeed.com:7300"
staticprivate

◆ DefaultPassword

readonly string com.dxfeed.api.DXEndpoint.DefaultPassword = "demo"
staticprivate

◆ DefaultUser

readonly string com.dxfeed.api.DXEndpoint.DefaultUser = "demo"
staticprivate

◆ endpointInstance

DXEndpoint com.dxfeed.api.DXEndpoint.endpointInstance = null
staticprivate

◆ instanceLocker

object com.dxfeed.api.DXEndpoint.instanceLocker = new object()
staticprivate

◆ password

string com.dxfeed.api.DXEndpoint.password = DefaultPassword
private

◆ stateLocker

object com.dxfeed.api.DXEndpoint.stateLocker = new object()
private

◆ user

string com.dxfeed.api.DXEndpoint.user = DefaultUser
private

Property Documentation

◆ Connection

IDxConnection com.dxfeed.api.DXEndpoint.Connection
getpackage

◆ Feed

IDXFeed com.dxfeed.api.DXEndpoint.Feed
getprivate set

Returns feed that is associated with this endpoint.

Returns
The feed.

◆ State

DXEndpointState com.dxfeed.api.DXEndpoint.State
getprivate set

Thread-safe state getter of this endpoint.

Event Documentation

◆ OnClosing

OnEndpointClosingEventHandler com.dxfeed.api.DXEndpoint.OnClosing

Event fires when Close() method was called.


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