INetwork Interface



Summary: Use this interface to control the nodes that your client connects to. To get a current listing use the GetNodeIDs method. Each node has full statistics and there are events to send raw packets straight to the client.


Network Properties and Settings:
  GetLocalIP
  GetLocalPort
  GetLocalSpeed
  ClientMode2
  GetNormalConnectedCount2
  GetChildConnectedCount2
  ForceUltrapeer2


Node Methods:
  ConnectNode2
  RemoveNode
  GetNodeIDs
  GetChildNodeIDs
  GetNodeIP
  GetNodePort
  GetNodeMode
  GetNodeState
  GetNodeHandshake
  GetNodeAgent
  GetNodeConnectTime


Node Statistic Methods:
  GetNodeBytesUp
  GetNodeBytesDown
  GetNodeBytesDropped
  GetNodePacketsPing
  GetNodePacketsPong
  GetNodePacketsQuery
  GetNodePacketsQueryHit
  GetNodePacketsPush
  GetNodePacketsTotal
  GetNodePacketsDown
  GetNodePacketsUp
  GetNodePacketsDropped


Lan Node Methods:
  LanModeOn
  LanModeOff
  JoinLan
  GetLanNodeIDs
  GetLanNodeName
  GetLanNodeLeaves


Network Events: (_INetworkEvent sink interface)
  OnChange
  OnPacketIncoming2
  OnPacketOutgoing2


Back to Interface Reference



GetLocalIP
  Params: None
  Return: Unsigned Long
  Remarks: Returns current known external IP address in 4 bytes


GetLocalPort
  Params: None
  Return: Long
  Remarks: Returns current listening port


GetLocalSpeed
  Params: None
  Return: Long
  Remarks: Returns fastest bytes received speed in kilobits per second


ClientMode2
  Params: Long (Network)
  Return: Long (Node Mode)
  Remarks: Returns state of client (supernode, etc..) for the particular network


GetNormalConnectedCount2
  Params: Long (Network)
  Return: Long
  Remarks: Returns number of connections, excluding children


GetChildConnectedCount2
  Params: Long (Network)
  Return: Long
  Remarks: Returns number of child connections


ForceUltrapeer2
  Params: Bool, Long (Network)
  Return: None
  Remarks: Forces the client to go into supernode mode




ConnectNode2
  Params: String Host, Long Port, Long (Network)
  Return: None
  Remarks: Attempt connection to node on specified network


RemoveNode
  Params: Long NodeID
  Return: None
  Remarks: Disconnect from node


GetNodeIDs
  Params: None
  Return: Long Array
  Remarks: Array of all nodes that GnucDNA is involved with


GetChildNodeIDs
  Params: None
  Return: Long Array
  Remarks: Array of all child(leaf) nodes that GnucDNA is involved with


GetNodeIP
  Params: Long NodeID
  Return: Unsigned Long
  Remarks: Returns Nodes IP in 4 bytes


GetNodePort
  Params: Long NodeID
  Return: Long
  Remarks: Returns port of node, might be 0 if node an incoming connection


GetNodeMode
  Params: Long NodeID
  Return: Long (Node Mode)
  Remarks: Return mode of node connected, Child, Ultrapeer or Neither


GetNodeState
  Params: Long NodeID
  Return: Long (Socket State)
  Remarks: Return the socket state of the node


GetNodeHandshake
  Params: Long NodeID
  Return: String
  Remarks: Returns full handshake between client and node


GetNodeAgent
  Params: Long NodeID
  Return: String
  Remarks: Returns User-Agent/Client Name of the remote node


GetNodeConnectTime
  Params: Long NodeID
  Return: Date
  Remarks: Return the time the node was connected to




GetNodeBytesUp
  Params: Long NodeID
  Return: Long
  Remarks: Returns total bytes sent in last second


GetNodeBytesDown
  Params: Long NodeID
  Return: Long
  Remarks: Returns total bytes received in last second


GetNodeBytesDropped
  Params: Long NodeID
  Return: Long
  Remarks: Returns total bytes dropped in last second


GetNodePacketsPing
  Params: Long NodeID, Long* Good, Long* Total
  Return: None
  Remarks: Sets Good and Total to the number of respecive ping packets in the last second from node


GetNodePacketsPong
  Params: Long NodeID, Long* Good, Long* Total
  Return: None
  Remarks: Sets Good and Total to the number of respecive pong packets in the last second


GetNodePacketsQuery
  Params: Long NodeID, Long* Good, Long* Total
  Return: None
  Remarks: Sets Good and Total to the number of respecive query packets in the last second


GetNodePacketsQueryHit
  Params: Long NodeID, Long* Good, Long* Total
  Return: None
  Remarks: Sets Good and Total to the number of respecive query hit packets in the last second from node


GetNodePacketsPush
  Params: Long NodeID, Long* Good, Long* Total
  Return: None
  Remarks: Sets Good and Total to the number of respecive push packets in the last second


GetNodePacketsTotal
  Params: Long NodeID, Long* Good, Long* Total
  Return: None
  Remarks: Sets Good and Total to the number of respecive packets in the last second


GetNodePacketsDown
  Params: Long NodeID
  Return: Double
  Remarks: Returns packets received per second, averaged over last minute


GetNodePacketsUp
  Params: Long NodeID
  Return: Double
  Remarks: Returns packets sent per second, averaged over last minute


GetNodePacketsDropped
  Params: Long NodeID
  Return: Double
  Remarks: Returns packets dropped per second, averaged over last minute




LanModeOn
  Params: None
  Return: None
  Remarks: Sets core into LAN mode, sends UDP broadcast for other LAN nodes. Use GetLanNodeIDs periodically to scan for results. All node and web caches are emptied when this is called.


LanModeOff
  Params: None
  Return: None
  Remarks: Turns LAN mode off and empties all node and web caches.


JoinLan
  Params: String LanName
  Return: None
  Remarks: This will start the connection process to nodes on the network with the same LAN name. Use GetLanName() to find available LANs on the network. Entering a new name creates a new network.


GetLanNodeIDs
  Params: None
  Return: Long Array
  Remarks: Returns array of Nodes found on the LAN


GetLanNodeName
  Params: Long LanNodeID
  Return: String
  Remarks: Returns the name of the LAN network the node is on


GetLanNodeLeaves
  Params: Long LanNodeID
  Return: Long
  Remarks: Returns the number of leaves this LAN node has, if any




OnChange
  Params: Long NodeID
  Return: None
  Remarks: Singnals change of Node state


OnPacketIncoming2
  Params: Long (Network), Bool TCP, Unsigned Long IP, Long Port, Byte Array packet, Long size, Bool Local, Long (Packet Error)
  Return: None
  Remarks: Raw incoming packet from node connection, if its a bad packet there is an Error code associated, local if meant for localhost


OnPacketOutgoing2
  Params: Long (Network), Bool TCP, Unsigned Long IP, Long Port, Byte Array packet, Long size, Bool Local
  Return: LNone
  Remarks: Raw outgoing packet to a node connection, local if created by localhost