FN
FN contains all global properties related to FigNet Core
Properties
Is library initialized or not
Read only Configuration instance, it gets populated based on ServerConfig.xml
Read only HandlerCollection instance, it is used to Register & UnRegister Handlers
Read only PeerCollection instance, it is used to get connected peers based on type or Id
Logger instance, we can set it to custom instance, it is used to log debug message to console or file
Read only List of Open ClientSocket Connection, it used to send and receive Messages to Server
Read only ServerSocket instance, it used to send and receive Messages to connected clients
Read only Dictionary of SerializeFunctions, it is used to serialize out going data (payloads of Messages)
Read only Dictionary of DeserializeFunctions, it is used to Deserialize in coming data (payloads of Messages)
Events
It is triggered on Settings (ServerConfig.xml) loaded
It is triggered after creation of IServerSocket & IClientSockets
Methods
Load Configuration based on ServerConfig.xml
Create Instances of IServerSocket, IClientSockets and Modules based on Configuration
Stop IServerSocket Instance & IClientSockets and dispose them
Load Modules as Plugin defined in ServerConfig.xml
Create ClientSocket Instance and Add it to FN.Connections list based on Peers in ServerConfig.xml
Params
int config : points to peers index in settings
IClientSocketListner socketListner : pass an instance to receiver socket events
Create ClientSocket Instance and Add it to FN.Connections list based on Peers in ServerConfig.xml
Params
PeerConfig peerConfig : PeerConfig that is used to create socket instance
IClientSocketListner socketListner : pass an instance to receiver socket events
When AutoConnect is true in ServerConfig.xml, then this method can be used to bind listners to ClientSockets of FN.Connections.
Note: call this method before OnInitialize event, OnSettingsLoaded event is a good place to register this event
This method can be used to bind listner to ServerSockets of FN.Server
Note: call this method before OnInitialize event, OnSettingsLoaded event is a good place to register this event
This method can be used to Remove a client connection from FN.Connections list and disconnect it by name
This method can be used to Remove a client connection from FN.Connections list and disconnect it by index of FN.Connections
This method is used to Register payload serialize and deserialize functions against messageId
By default if Logging level is set to ALL in ServerConfig.xml, the logger will log detailed log of every comming messages. This method can be used to view detailed log of subscribed messages only.
This method is used to unsubscribe the detailed log of perticular message.
Note: if there is no message is subscribed the logger will print all in comming message
Last updated
Was this helpful?