-
Notifications
You must be signed in to change notification settings - Fork 1
Network Library Documentation
Client | InfosClient |
Locker | LockManager |
Server |
Client class for the Network library. This class allow the user to start a transmission in order to receive and send requests to a single Server.
Static callback method for the server request
Trigered function when the server want to communicate with the client
Name | Description |
---|---|
header |
NetworkCommsDotNet.PacketHeader |
connection |
NetworkCommsDotNet.Connections.Connection |
data |
System.String Data send by the server |
Destructor of the Client. When called, it'll shutdown all the transmissions
Getter for the singleton instance of a Client
Static callback method for the chat server request
Get a msg for the chat from the server
Name | Description |
---|---|
header |
NetworkCommsDotNet.PacketHeader |
connection |
NetworkCommsDotNet.Connections.Connection |
msg |
System.String |
Send an object to the server (you will minimum need "public string name" in your object
Name | Description |
---|---|
data |
System.Object |
Send a msg for the chat to the server
Name | Description |
---|---|
msg |
System.String |
Launch the ClientNetwork
Name | Description |
---|---|
callBackFct |
System.Func{System.Object,System.Int32} Function called when the client receive a message from the server |
msgCallbackFct |
System.Func{System.String,System.Int32} Function called when the client received a chat message from the server |
serverIP |
System.String Ip of the server you want to connect to |
serverPort |
System.Int32 Port of the server you want to connect to |
A class which contains the network information for a client.
A System.String for the IP of the client
An System.Int32 for the port of the client
Class designed to lock and unlock asynchronous event. Usually managed by a LockManager.
Second constructor of the Locker, allowing the user to customize the timeout duration.
Name | Description |
---|---|
key_ |
System.UInt32 The unique key code of the Locker |
username_ |
System.String The username of the Locker's owner |
duration_ |
System.Int32 The duration of the lock period timeout. |
Main constructor of the Locker
Name | Description |
---|---|
key_ |
System.UInt32 The unique key code of the Locker |
username_ |
System.String The username of the Locker's owner |
Getter and Setter for the timeout duration of the Locker
Getter and Setter for the Locker key
Getter and Setter for the current State of the Locker
Getter and Setter for the Username of the owner of the Locker
Class used to store, delete, lock and unlock Locker
Add a new Locker in the manager
Name | Description |
---|---|
username |
System.String The owner of the Locker |
This method return the generated key of the Locker
Delete the locker associated to the key given in parameter
Name | Description |
---|---|
key |
System.UInt32 The key of the Locker |
True if the Locker has been successfully deleted, false otherwise.
Lock the Locker linked to the key given in parameter and wait for a call to LockManager.Unlock(System.UInt32)
Name | Description |
---|---|
key |
System.UInt32 The key of the Locker |
False if no Locker has been found with this key, true otherwise
Getter and Setter for the Dictionnary of Lockers, which assign an System.UInt32 key to its Locker
Unlock the Locker linked to the key given in parameter.
Name | Description |
---|---|
key |
System.UInt32 The key of the Locker |
False if the manager does not contain a Locker with this key, true otherwise
Server class for the Network library. This class allow the user to start a transmission in order to receive and send requests to multiples Client.
Current client ID
Callback method which will be called when the server receive client request
A getter and a setter to a dictionnary which link for each client's name their network informations (InfosClient)
Delete a client to the server
Name | Description |
---|---|
name |
System.String |
Destructor for the Server class. It will shutdwon the connection.
Get ip of the pc
A getter and a setter for the server singleton instance
A getter and a setter for the stored LockerManager wich will manager all the synchronous network operations
Get a Msg from a client for the chat
Name | Description |
---|---|
header |
NetworkCommsDotNet.PacketHeader |
connection |
NetworkCommsDotNet.Connections.Connection |
msg |
System.String |
Send an object to a client
Name | Description |
---|---|
name |
System.String Name of the client you want to send something |
data |
CardGameResources.Net.Packet |
Send a msg to all the clients for the chat
Name | Description |
---|---|
msg |
System.String |
Function trigered by the server when the client send a request
Name | Description |
---|---|
header |
NetworkCommsDotNet.PacketHeader |
connection |
NetworkCommsDotNet.Connections.Connection |
data |
System.String Data sent by the client |
Name | Description |
---|---|
callBackFct |
System.Func{System.Object,System.Int32} Function called when the client receive a request from the client |
Stop the server by closing all packet handlers and stop the request listening. It also delete all the client's infos