I'm using a Socket to connect to a TCP Server. However, when I try to connect, the whole program freezes. How can I make it so the program doesn't freeze but will still attempt to connect?
That's my connection code.
_socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
try
{
_socket.Connect(IP, Port);
}