Jonno Posted February 25, 2004 Posted February 25, 2004 In visual studio 2003 can you no longer just use the port number as an argument?Do you have to specify an IP address, is there no way around using an IP address? Quote
Wessel Posted February 25, 2004 Posted February 25, 2004 Not sure about the tcpListener class, but i think it takes a IPEndPoint object: IPEndPoint _endp = new IPEndPoint(IPAddress.Any,80); Quote
sde Posted February 25, 2004 Posted February 25, 2004 I don't know if this helps, but i recently use the TcpClient class with an ip and port like this: TcpClient myclient = new TcpClient("1.2.3.4",5000); NetworkStream ns = new NetworkStream(myclient); StreamReader sr = new StreamReader(ns); StreamWriter sw = new StreamWriter(sw); sw.WriteLine("Hello Server"); sw.Flush(); string s = sr.ReadLine(); Console.WriteLine(s); Quote codenewbie
sde Posted February 25, 2004 Posted February 25, 2004 I'm sorry, that was for the client side, .. on my server side i just use the Port number. I think you are supposed to use an IPAddress Object, but it will still work with just the port. TcpListener listener = new Tcplistener(5000); disclaimer: I'm still new at this so I'm just telling you what works for me. :) Quote codenewbie
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.