Implementation of the RemoteEndpoint
interface as an Ixian network client.
More...
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< TimeSyncData > | timeSyncs = new List<TimeSyncData>() |
bool | enableSendTimeSyncMessages = true |
Implementation of the RemoteEndpoint
interface as an Ixian network client.
Definition at line 12 of file NetworkClient.cs.
DLT.NetworkClient.NetworkClient | ( | ) |
Definition at line 25 of file NetworkClient.cs.
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.
hostname | Hostname or IP address of the remote server |
port | Port on which to connect |
wallet_address | Expected wallet address of the remote server we are connecting to. |
Definition at line 52 of file NetworkClient.cs.
|
virtual |
Breaks the connection to the remote server.
Reimplemented from DLT.RemoteEndpoint.
Definition at line 160 of file NetworkClient.cs.
int DLT.NetworkClient.getTotalReconnectsCount | ( | ) |
Returns the number of times this connection was re-established (disconnected and reconnected).
Definition at line 170 of file NetworkClient.cs.
bool DLT.NetworkClient.reconnect | ( | ) |
Disconnects (optionally) and reconnects to the same remote host as was given in connectToServer()
.
Definition at line 129 of file NetworkClient.cs.
|
protectedvirtual |
Reimplemented from DLT.RemoteEndpoint.
Definition at line 150 of file NetworkClient.cs.
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.