Ixian network server object. This is used to accept connections from Ixian clients or other nodes and recieve Ixian protocol messages. Basic protocol validation is performed before a specialized protocol parser is called.
More...
|
static void | beginNetworkOperations () |
| Starts listening for and accepting network connections. More...
|
|
static void | stopNetworkOperations () |
| Stops listening for new connections and disconnects all connected clients. More...
|
|
static void | handleDisconnectedClients () |
| Checks the list of clients and removes the ones who have disconnected since the last check. More...
|
|
static void | restartNetworkOperations () |
| Restarts the network server. More...
|
|
static bool | broadcastData (char[] types, ProtocolMessageCode code, byte[] data, byte[] helper_data, RemoteEndpoint skipEndpoint=null) |
| Sends the given data to all appropriate connected clients. More...
|
|
static bool | broadcastEventData (NetworkEvents.Type type, ProtocolMessageCode code, byte[] data, byte[] address, byte[] helper_data, RemoteEndpoint skipEndpoint=null) |
| Sends the specified event to all connected clients. The information is only sent to those clients who have previously subscribed to this event type More...
|
|
static bool | forwardMessage (byte[] address, ProtocolMessageCode code, byte[] message) |
| Sends the specified network message to the given address, if it is known and connected among clients. More...
|
|
static bool | sendToClient (string neighbor, ProtocolMessageCode code, byte[] data, byte[] helper_data) |
| Sends the protocol message to the specified neighbor node, given as a Hostname or IP address and port. More...
|
|
static string [] | getConnectedClients (bool useIncomingPort=false) |
| Retrieves all connected remote endpoints as hostnames or IP addresses and optionally ports. More...
|
|
static bool | removeEndpoint (RemoteEndpoint endpoint) |
| Removes the given endpoint from the connected client list, but does not immediately issue a disconnect message. More...
|
|
static int | getQueuedMessageCount () |
| Retrieves the number of queued outgoing messages for all clients. More...
|
|
static RemoteEndpoint | getClient (int idx) |
| Gets the client by sequential index. More...
|
|
static void | blacklistNode (string ip) |
| Adds the speficied node to the blacklist by public IP. More...
|
|
static bool | isNodeBlacklisted (string ip) |
| Checks if the specified IP is blacklisted. More...
|
|
static bool | isRunning () |
| Checks if the server is running. More...
|
|
static bool | isConnectable () |
| Returns if the server is proven to be connectable. (Someone has connected to the server successfully within the past 5 minutes.) More...
|
|
Ixian network server object. This is used to accept connections from Ixian clients or other nodes and recieve Ixian protocol messages. Basic protocol validation is performed before a specialized protocol parser is called.
Definition at line 25 of file NetworkServer.cs.
◆ beginNetworkOperations()
static void IXICore.Network.NetworkServer.beginNetworkOperations |
( |
| ) |
|
|
static |
Starts listening for and accepting network connections.
Definition at line 47 of file NetworkServer.cs.
◆ blacklistNode()
static void IXICore.Network.NetworkServer.blacklistNode |
( |
string |
ip | ) |
|
|
static |
Adds the speficied node to the blacklist by public IP.
- Parameters
-
Definition at line 538 of file NetworkServer.cs.
◆ broadcastData()
static bool IXICore.Network.NetworkServer.broadcastData |
( |
char [] |
types, |
|
|
ProtocolMessageCode |
code, |
|
|
byte [] |
data, |
|
|
byte [] |
helper_data, |
|
|
RemoteEndpoint |
skipEndpoint = null |
|
) |
| |
|
static |
Sends the given data to all appropriate connected clients.
- Parameters
-
types | Types of clients to which the data should be sent. |
code | Type of the protocol message being sent. |
data | Byte-field of the data, appropriate for the specific code used. |
helper_data | Optional, additional data to transmit after data . |
skipEndpoint | If given, the message will not be sent to this remote endpoint. This prevents echoing the message to the originating node. |
- Returns
- True, if at least one message was sent to at least one client.
Definition at line 218 of file NetworkServer.cs.
◆ broadcastEventData()
Sends the specified event to all connected clients. The information is only sent to those clients who have previously subscribed to this event type
- Parameters
-
type | Types of the event that has occurred. |
code | Type of the protocol message being sent. |
data | Byte-field of the data, appropriate for the specific code used. |
address | Ixian Wallet Address which triggered the event |
helper_data | Optional, additional data to transmit after data . |
skipEndpoint | If given, the message will not be sent to this remote endpoint. This prevents echoing the message to the originating node. |
- Returns
- True, if at least one message was sent to at least one client.
Definition at line 267 of file NetworkServer.cs.
◆ forwardMessage()
static bool IXICore.Network.NetworkServer.forwardMessage |
( |
byte [] |
address, |
|
|
ProtocolMessageCode |
code, |
|
|
byte [] |
message |
|
) |
| |
|
static |
Sends the specified network message to the given address, if it is known and connected among clients.
- Parameters
-
address | Ixian Wallet Address - the recipient of the message |
code | Type of the network message to send |
message | Byte-field with the required data, as specified by code . |
- Returns
- True, if the message was delivered.
Definition at line 321 of file NetworkServer.cs.
◆ getClient()
static RemoteEndpoint IXICore.Network.NetworkServer.getClient |
( |
int |
idx | ) |
|
|
static |
Gets the client by sequential index.
- Parameters
-
idx | Sequential index of the client. |
- Returns
- Client at the given index, or null if out of bounds.
Definition at line 511 of file NetworkServer.cs.
◆ getConnectedClients()
static string [] IXICore.Network.NetworkServer.getConnectedClients |
( |
bool |
useIncomingPort = false | ) |
|
|
static |
Retrieves all connected remote endpoints as hostnames or IP addresses and optionally ports.
- Parameters
-
useIncomingPort | Whether the TCP port information should be included. |
- Returns
- List of connected clients with optional port information.
Definition at line 392 of file NetworkServer.cs.
◆ getQueuedMessageCount()
static int IXICore.Network.NetworkServer.getQueuedMessageCount |
( |
| ) |
|
|
static |
Retrieves the number of queued outgoing messages for all clients.
- Returns
- Number of messages in all outgoing queues
Definition at line 493 of file NetworkServer.cs.
◆ handleDisconnectedClients()
static void IXICore.Network.NetworkServer.handleDisconnectedClients |
( |
| ) |
|
|
static |
Checks the list of clients and removes the ones who have disconnected since the last check.
Definition at line 112 of file NetworkServer.cs.
◆ isConnectable()
static bool IXICore.Network.NetworkServer.isConnectable |
( |
| ) |
|
|
static |
Returns if the server is proven to be connectable. (Someone has connected to the server successfully within the past 5 minutes.)
- Returns
- True, if the server is connectable from the Internet.
Definition at line 582 of file NetworkServer.cs.
◆ isNodeBlacklisted()
static bool IXICore.Network.NetworkServer.isNodeBlacklisted |
( |
string |
ip | ) |
|
|
static |
Checks if the specified IP is blacklisted.
- Parameters
-
- Returns
- True, if the node is blacklisted.
Definition at line 551 of file NetworkServer.cs.
◆ isRunning()
static bool IXICore.Network.NetworkServer.isRunning |
( |
| ) |
|
|
static |
Checks if the server is running.
- Returns
- True, if the network server is running and accepting connections.
Definition at line 572 of file NetworkServer.cs.
◆ removeEndpoint()
static bool IXICore.Network.NetworkServer.removeEndpoint |
( |
RemoteEndpoint |
endpoint | ) |
|
|
static |
Removes the given endpoint from the connected client list, but does not immediately issue a disconnect message.
- Parameters
-
endpoint | Endpoint to remove |
- Returns
- True if the endpoint was removed or false if the endpoint was not known.
Definition at line 479 of file NetworkServer.cs.
◆ restartNetworkOperations()
static void IXICore.Network.NetworkServer.restartNetworkOperations |
( |
| ) |
|
|
static |
◆ sendToClient()
static bool IXICore.Network.NetworkServer.sendToClient |
( |
string |
neighbor, |
|
|
ProtocolMessageCode |
code, |
|
|
byte [] |
data, |
|
|
byte [] |
helper_data |
|
) |
| |
|
static |
Sends the protocol message to the specified neighbor node, given as a Hostname or IP address and port.
- Parameters
-
neighbor | IP address or hostname and port for the neighbor. |
code | Type of the protocol message |
data | Data required by the protocol message code . |
helper_data | Optional, additional data to transmit after data . |
- Returns
- True if the data was sent to the specified neighbor.
Definition at line 365 of file NetworkServer.cs.
◆ stopNetworkOperations()
static void IXICore.Network.NetworkServer.stopNetworkOperations |
( |
| ) |
|
|
static |
Stops listening for new connections and disconnects all connected clients.
Definition at line 79 of file NetworkServer.cs.
◆ connectable
bool IXICore.Network.NetworkServer.connectable = true |
|
static |
Flag, indicating whether the listening socket is open and accepting connections.
Definition at line 42 of file NetworkServer.cs.
◆ connectedClients
The documentation for this class was generated from the following file: