public static void StartConnection(bool isConsole, string ipAddress, int port) { _socket = new Socket(SocketType.Stream, ProtocolType.Tcp); _socket.Connect(ipAddress, port); _connection = new PacketProtocol(65535); _connection.MessageArrived = onMessageReceived; _data = new byte[1]; }
public Connection(Socket sckt) { _socket = sckt; var endPoint = (IPEndPoint)_socket.RemoteEndPoint; IpAddress = endPoint.Address; UUID = Guid.NewGuid(); _data = new byte[1]; _connection = new PacketProtocol(65535); _connection.MessageArrived = onMessageReceived; }