Ixian SDK
DLT.NetworkClient Class Reference

Implementation of the RemoteEndpoint interface as an Ixian network client. More...

Inheritance diagram for DLT.NetworkClient:
DLT.RemoteEndpoint

Public Member Functions

 NetworkClient ()
 
bool connectToServer (string hostname, int port, byte[] wallet_address)
 Establishes connection to the given hostname and port. An expected remote wallet address must be provided before a connection to the Ixian network can be made safely. More...
 
bool reconnect ()
 Disconnects (optionally) and reconnects to the same remote host as was given in connectToServer(). More...
 
override void disconnect ()
 Breaks the connection to the remote server. More...
 
int getTotalReconnectsCount ()
 Returns the number of times this connection was re-established (disconnected and reconnected). More...
 
- Public Member Functions inherited from DLT.RemoteEndpoint
void start (Socket socket=null)
 
void stop ()
 
void sendData (ProtocolMessageCode code, byte[] data, byte[] helper_data=null)
 
int getQueuedMessageCount ()
 
bool isConnected ()
 
string getFullAddress (bool useIncomingPorts=false)
 
void setLegacy (bool legacy)
 
bool isLegacy ()
 
bool attachEvent (NetworkEvents.Type type, byte[] address)
 
bool detachEvent (NetworkEvents.Type type, byte[] address)
 
bool isSubscribedToEvent (NetworkEvents.Type type, byte[] address)
 
long calculateTimeDifference ()
 

Public Attributes

TcpClient tcpClient = null
 Unerlying framework connection, if an operation must be performed directly on it. More...
 
- Public Attributes inherited from DLT.RemoteEndpoint
string fullAddress = "127.0.0.1:10000"
 
string address = "127.0.0.1"
 
int incomingPort = Config.serverPort
 
long timeDifference = 0
 
bool timeSyncComplete = false
 
bool helloReceived = false
 
ulong blockHeight = 0
 
bool fullyStopped = false
 
IPEndPoint remoteIP
 
Socket clientSocket
 
RemoteEndpointState state
 
Presence presence = null
 
PresenceAddress presenceAddress = null
 
byte [] serverWalletAddress = null
 
byte [] serverPubKey = null
 
byte [] challenge = null
 

Protected Member Functions

override void recvLoop ()
 
- Protected Member Functions inherited from DLT.RemoteEndpoint
void prepareSocket (Socket socket)
 
void sendTimeSyncMessages ()
 
void sendLoop ()
 
void parseLoop ()
 
void parseDataInternal (byte[] data, RemoteEndpoint endpoint)
 
void sendDataInternal (ProtocolMessageCode code, byte[] data, byte[] checksum)
 
void readTimeSyncData ()
 
byte [] readSocketData ()
 

Additional Inherited Members

- Protected Attributes inherited from DLT.RemoteEndpoint
long lastDataReceivedTime = 0
 
long lastDataSentTime = 0
 
Thread recvThread = null
 
Thread sendThread = null
 
Thread parseThread = null
 
bool running = false
 
List< TimeSyncDatatimeSyncs = new List<TimeSyncData>()
 
bool enableSendTimeSyncMessages = true
 

Detailed Description

Implementation of the RemoteEndpoint interface as an Ixian network client.

Definition at line 12 of file NetworkClient.cs.

Constructor & Destructor Documentation

◆ NetworkClient()

DLT.NetworkClient.NetworkClient ( )

Definition at line 25 of file NetworkClient.cs.

Member Function Documentation

◆ connectToServer()

bool DLT.NetworkClient.connectToServer ( string  hostname,
int  port,
byte []  wallet_address 
)

Establishes connection to the given hostname and port. An expected remote wallet address must be provided before a connection to the Ixian network can be made safely.

Parameters
hostnameHostname or IP address of the remote server
portPort on which to connect
wallet_addressExpected wallet address of the remote server we are connecting to.
Returns
True, if the connection was successful.

Definition at line 52 of file NetworkClient.cs.

◆ disconnect()

override void DLT.NetworkClient.disconnect ( )
virtual

Breaks the connection to the remote server.

Reimplemented from DLT.RemoteEndpoint.

Definition at line 160 of file NetworkClient.cs.

◆ getTotalReconnectsCount()

int DLT.NetworkClient.getTotalReconnectsCount ( )

Returns the number of times this connection was re-established (disconnected and reconnected).

Returns
Number of connection attempts.

Definition at line 170 of file NetworkClient.cs.

◆ reconnect()

bool DLT.NetworkClient.reconnect ( )

Disconnects (optionally) and reconnects to the same remote host as was given in connectToServer().

Returns
True, if the connection attempt was successful.

Definition at line 129 of file NetworkClient.cs.

◆ recvLoop()

override void DLT.NetworkClient.recvLoop ( )
protectedvirtual

Reimplemented from DLT.RemoteEndpoint.

Definition at line 150 of file NetworkClient.cs.

Member Data Documentation

◆ tcpClient

TcpClient DLT.NetworkClient.tcpClient = null

Unerlying framework connection, if an operation must be performed directly on it.

Definition at line 17 of file NetworkClient.cs.


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