示例#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}");
    }
示例#2
0
 public override void ServerStart()
 {
     _ = server.ListenAsync(port);
 }