diff --git a/Exomia.Network/ClientActionHandler.cs b/Exomia.Network/ClientActionHandler.cs
index b290c72..b7074ac 100644
--- a/Exomia.Network/ClientActionHandler.cs
+++ b/Exomia.Network/ClientActionHandler.cs
@@ -17,8 +17,8 @@ namespace Exomia.Network
/// Type of the server client.
/// The server.
/// The client.
- public delegate void ClientActionHandler(IServer server,
- TServerClient client)
+ public delegate void ClientActionHandler(IServer server,
+ TServerClient client)
where T : class
where TServerClient : ServerClientBase;
}
\ No newline at end of file
diff --git a/Exomia.Network/ClientDataReceivedHandler.cs b/Exomia.Network/ClientDataReceivedHandler.cs
index e25662a..a76ba7e 100644
--- a/Exomia.Network/ClientDataReceivedHandler.cs
+++ b/Exomia.Network/ClientDataReceivedHandler.cs
@@ -20,11 +20,11 @@ namespace Exomia.Network
/// Identifier for the command.
/// The data.
/// Identifier for the response.
- public delegate void ClientCommandDataReceivedHandler(IServer server,
- TServerClient client,
- uint commandID,
- object data,
- uint responseID)
+ public delegate void ClientCommandDataReceivedHandler(IServer server,
+ TServerClient client,
+ uint commandID,
+ object data,
+ uint responseID)
where T : class
where TServerClient : ServerClientBase;
@@ -40,10 +40,10 @@ public delegate void ClientCommandDataReceivedHandler(ISer
///
/// true if you want to handle more data; false otherwise.
///
- public delegate bool ClientDataReceivedHandler(IServer server,
- TServerClient client,
- object data,
- uint responseID)
+ public delegate bool ClientDataReceivedHandler(IServer server,
+ TServerClient client,
+ object data,
+ uint responseID)
where T : class
where TServerClient : ServerClientBase;
}
\ No newline at end of file
diff --git a/Exomia.Network/ClientDisconnectHandler.cs b/Exomia.Network/ClientDisconnectHandler.cs
index dd3956c..de1ffa7 100644
--- a/Exomia.Network/ClientDisconnectHandler.cs
+++ b/Exomia.Network/ClientDisconnectHandler.cs
@@ -18,9 +18,9 @@ namespace Exomia.Network
/// The server.
/// The client.
/// The reason.
- public delegate void ClientDisconnectHandler(IServer server,
- TServerClient client,
- DisconnectReason reason)
+ public delegate void ClientDisconnectHandler(IServer server,
+ TServerClient client,
+ DisconnectReason reason)
where T : class
where TServerClient : ServerClientBase;
}
\ No newline at end of file
diff --git a/Exomia.Network/Exomia.Network.csproj b/Exomia.Network/Exomia.Network.csproj
index 5f51eba..a273678 100644
--- a/Exomia.Network/Exomia.Network.csproj
+++ b/Exomia.Network/Exomia.Network.csproj
@@ -4,7 +4,7 @@
exomia
tcp / udp client and server
Copyright © $([System.DateTime]::Now.Year) exomia
- 1.4.1.5
+ 1.4.2.0
https://raw.githubusercontent.com/exomia/network/master/LICENSE
https://github.com/exomia/network
true
diff --git a/Exomia.Network/IServer.cs b/Exomia.Network/IServer.cs
index 9462b2e..ca246c6 100644
--- a/Exomia.Network/IServer.cs
+++ b/Exomia.Network/IServer.cs
@@ -18,19 +18,9 @@ namespace Exomia.Network
///
/// Generic type parameter.
/// Type of the server client.
- public interface IServer : IDisposable
- where T : class
- where TServerClient : ServerClientBase
+ public interface IServer : IDisposable
+ where TServerClient : IServerClient
{
- ///
- /// Runs.
- ///
- /// The port.
- ///
- /// True if it succeeds, false if it fails.
- ///
- bool Run(int port);
-
///
/// Sends data to the client.
///
diff --git a/Exomia.Network/Lib/ServerClientEventEntry.cs b/Exomia.Network/Lib/ServerClientEventEntry.cs
index 75936b8..d66dfb7 100644
--- a/Exomia.Network/Lib/ServerClientEventEntry.cs
+++ b/Exomia.Network/Lib/ServerClientEventEntry.cs
@@ -64,7 +64,7 @@ public void Remove(ClientDataReceivedHandler callback)
/// The client.
/// The data.
/// The responseID.
- public void Raise(IServer server, TServerClient client, object data, uint responseID)
+ public void Raise(IServer server, TServerClient client, object data, uint responseID)
{
for (int i = _dataReceived.Count - 1; i >= 0; --i)
{
diff --git a/Exomia.Network/ServerBase.cs b/Exomia.Network/ServerBase.cs
index 32efb46..8568031 100644
--- a/Exomia.Network/ServerBase.cs
+++ b/Exomia.Network/ServerBase.cs
@@ -25,7 +25,7 @@ namespace Exomia.Network
///
/// Socket|Endpoint.
/// Type of the server client.
- public abstract class ServerBase : IServer
+ public abstract class ServerBase : IServer
where T : class
where TServerClient : ServerClientBase
{
@@ -151,7 +151,13 @@ private protected ServerBase()
Dispose(false);
}
- ///
+ ///
+ /// Runs.
+ ///
+ /// Port.
+ ///
+ /// True if it succeeds, false if it fails.
+ ///
public bool Run(int port)
{
if (_isRunning) { return true; }
@@ -264,13 +270,12 @@ protected virtual void OnClientConnected(TServerClient client) { }
///
/// Create a new ServerClient than a client connects.
///
- /// Socket|EndPoint.
/// [out] out new ServerClient.
///
/// true if the new ServerClient should be added to the clients list; false
/// otherwise.
///
- protected abstract bool CreateServerClient(T arg0, out TServerClient serverClient);
+ protected abstract bool CreateServerClient(out TServerClient serverClient);
///
/// Executes the client disconnect on a different thread, and waits for the result.
@@ -332,8 +337,9 @@ private protected virtual void OnAfterClientDisconnect(TServerClient client) { }
/// Socket|Endpoint.
private void InvokeClientConnected(T arg0)
{
- if (CreateServerClient(arg0, out TServerClient serverClient))
+ if (CreateServerClient(out TServerClient serverClient))
{
+ serverClient.Arg0 = arg0;
bool lockTaken = false;
try
{
@@ -353,10 +359,10 @@ private void InvokeClientConnected(T arg0)
#region Add & Remove
///
- /// add a command.
+ /// add commands deserializers.
///
- /// Identifier for the command.
/// The deserialize handler.
+ /// A variable-length parameters list containing command ids.
///
/// Thrown when one or more arguments are outside
/// the required range.
@@ -365,24 +371,29 @@ private void InvokeClientConnected(T arg0)
/// Thrown when one or more required arguments
/// are null.
///
- public void AddCommand(uint commandID, DeserializePacketHandler