W
weird0
I am a beginner to socket programming to in c#. I know the concepts
as to how to program them. I get the above exception when i tried
writing the code for the server side on the line tcpListener.Start()
when i passed the localhost ip and port no. 4000:
Please help...
namespace Server
{
class Server
{
TcpListener tcpListener;
IPAddress ipAddress;
IPEndPoint remoteEP;
public Server(string ipaddress, int Port)
{
ipAddress = IPAddress.Parse(ipaddress);
tcpListener = new TcpListener(ipAddress,Port);
remoteEP = new IPEndPoint(ipAddress, Port);
}
public void Start()
{
try
{
tcpListener.Start(); // line of exception
}
catch (Exception ex)
{
MessageBox.Show("Problem:" + ex.Message);
}
}
public void Stop()
{
tcpListener.Stop();
}
}
}
as to how to program them. I get the above exception when i tried
writing the code for the server side on the line tcpListener.Start()
when i passed the localhost ip and port no. 4000:
Please help...
namespace Server
{
class Server
{
TcpListener tcpListener;
IPAddress ipAddress;
IPEndPoint remoteEP;
public Server(string ipaddress, int Port)
{
ipAddress = IPAddress.Parse(ipaddress);
tcpListener = new TcpListener(ipAddress,Port);
remoteEP = new IPEndPoint(ipAddress, Port);
}
public void Start()
{
try
{
tcpListener.Start(); // line of exception
}
catch (Exception ex)
{
MessageBox.Show("Problem:" + ex.Message);
}
}
public void Stop()
{
tcpListener.Stop();
}
}
}