efexD
January 4th, 2009, 10:14 PM
Well, after trying to connect to a basic server, I get nothing. No messages. Nothing. It seems like it just hangs. Does this have to do with it being on linux or am i doing something wrong?
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
class Program
{
public static void Main()
{
IPAddress serverIp = IPAddress.Parse("24.81.233.184");
IPEndPoint serverPort = new IPEndPoint(serverIp, 4837);
Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
try
{
sock.Connect(serverPort);
Console.WriteLine("Connected to server.");
}
catch (SocketException e)
{
Console.WriteLine("Couldn't connect to server!");
Console.WriteLine(e.ToString());
sock.Close();
return;
}
}
}
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
class Program
{
public static void Main()
{
IPAddress serverIp = IPAddress.Parse("24.81.233.184");
IPEndPoint serverPort = new IPEndPoint(serverIp, 4837);
Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
try
{
sock.Connect(serverPort);
Console.WriteLine("Connected to server.");
}
catch (SocketException e)
{
Console.WriteLine("Couldn't connect to server!");
Console.WriteLine(e.ToString());
sock.Close();
return;
}
}
}