markiodev/Networker

ClientDisconnected problem

Closed this issue · 1 comments

Hi just tested your library and found a issue about this event, ClientDisconnected on server never trigger.
There is a second problem, there is no ClientConnected and Close/Disconnect on client side

example:

``

    public ApisServer(string host, int port)
    {
        Host = host;
        Port = port;
        server = new NetworkerServerBuilder()
            .UseIpAddresses(new[] {host}).UseConsoleLogger().UseTcp(port)
            .RegisterPacketHandler<CL_Login, LoginHandler>()
            .Build<DefaultServer>();

        server.ClientConnected += ClientConnected;
        server.ClientDisconnected += ClientDisconnected;
    }

    private void ClientDisconnected(object sender, TcpConnectionDisconnectedEventArgs e)
    {
        Logger.Debug("Client disconnected {0}", e.Connection.Identifier); // Never trigger
    }

    private void ClientConnected(object sender, TcpConnectionConnectedEventArgs e)
    {
        Logger.Debug("Client connected {0}", e.Connection.Identifier);
    }

``

I have tested the server events and added them to example, they appear to be working. I have also added events for the client.