/// <summary>Initializes the newly connected client's TCP-related info.</summary> /// <param name="socket">The TcpClient instance of the newly connected client.</param> public void Connect(TcpClient socket) { this.socket = socket; this.socket.ReceiveBufferSize = dataBufferSize; this.socket.SendBufferSize = dataBufferSize; stream = this.socket.GetStream(); receivedData = new Packet(); receiveBuffer = new byte[dataBufferSize]; stream.BeginRead(receiveBuffer, 0, dataBufferSize, ReceiveCallback, null); string welcomeMessage = $"Welcome to the server! Your player ID is : {id}."; ServerSend.Welcome(id, welcomeMessage); }