Exemple #1
0
    private void StartAsyncServer(ushort port)
    {
        asyncServer = new Mirror.Tcp.Server();

        asyncServer.ReceivedData += (connId, data) =>
        {
            asyncServer.Send(connId, new ArraySegment <byte>(data));
        };


        _       = asyncServer.ListenAsync(port);
        started = true;

        Debug.Log($"Async Tcp started at port {port}");
    }
 public override bool ServerSend(int connectionId, int channelId, byte[] data)
 {
     server.Send(connectionId, data);
     return(true);
 }