Ixian SDK
IXICore.Network.NetworkClient Class Reference

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

Inheritance diagram for IXICore.Network.NetworkClient:
IXICore.Network.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 IXICore.Network.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)
 
bool attachEvent (NetworkEvents.Type type, byte[] address)
 
bool detachEvent (NetworkEvents.Type type, byte[] address)
 
bool isSubscribedToEvent (NetworkEvents.Type type, byte[] address)
 
bool detachEvents (NetworkEvents.Type type)
 
long calculateTimeDifference ()
 

Public Attributes

TcpClient tcpClient = null
 Unerlying framework connection, if an operation must be performed directly on it. More...
 
- Public Attributes inherited from IXICore.Network.RemoteEndpoint
string fullAddress = "127.0.0.1:0"
 
string address = "127.0.0.1"
 
int incomingPort = 0
 
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 IXICore.Network.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 IXICore.Network.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 10 of file NetworkClient.cs.

Constructor & Destructor Documentation

◆ NetworkClient()

IXICore.Network.NetworkClient.NetworkClient ( )

Definition at line 23 of file NetworkClient.cs.

Member Function Documentation

◆ connectToServer()

bool IXICore.Network.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 50 of file NetworkClient.cs.

◆ disconnect()

override void IXICore.Network.NetworkClient.disconnect ( )
virtual

Breaks the connection to the remote server.

Reimplemented from IXICore.Network.RemoteEndpoint.

Definition at line 158 of file NetworkClient.cs.

◆ getTotalReconnectsCount()

int IXICore.Network.NetworkClient.getTotalReconnectsCount ( )

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

Returns
Number of connection attempts.

Definition at line 168 of file NetworkClient.cs.

◆ reconnect()

bool IXICore.Network.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 127 of file NetworkClient.cs.

◆ recvLoop()

override void IXICore.Network.NetworkClient.recvLoop ( )
protectedvirtual

Reimplemented from IXICore.Network.RemoteEndpoint.

Definition at line 148 of file NetworkClient.cs.

Member Data Documentation

◆ tcpClient

TcpClient IXICore.Network.NetworkClient.tcpClient = null

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

Definition at line 15 of file NetworkClient.cs.


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