private void SocketAccept(IAsyncResult _result) { Socket clientSocket = socket.EndAccept(_result); Console.WriteLine("One user connect"); ServerUnit <T> serverUnit = new ServerUnit <T>(); lock (noLoginList) { noLoginList.Add(serverUnit); serverUnit.Init(clientSocket, tick); } BeginAccept(); }
private void SocketAccept(IAsyncResult _result) { Socket clientSocket = socket.EndAccept(_result); Console.WriteLine("One user connected"); T unit = new T(); ServerUnit serverUnit = new ServerUnit(); lock (list) { list.Add(serverUnit); } serverUnit.Init(clientSocket, unit); unit.Init(serverUnit.SendData); BeginAccept(); }