tcplistener problem

robertuk702

Member
Joined
Apr 23, 2006
Messages
15
Programming Experience
Beginner
Hi,

I got the first code to work....

The second program, which would be the server program has a problem with:
const port as integer = 8000
dim tcpListener as TcpListener(port)
error when place cursor red tcplistener is 'public sub new(port as integer) is obsolete: Use TcpListener(ipaddr localaddr, init port)'

I think it means do not define port, but enter something like ("127.0.0.1",8000) - but this seems to be an error.

Can you show me the right road with this please?

Thank you for your help.

Regards.
 
Here you go:

VB.NET:
[SIZE=2]
[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] [COLOR=black]TCPL[/COLOR] [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] [COLOR=black]TcpListener[/COLOR]
[COLOR=black]TCPL =[/COLOR] [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] [COLOR=black]TcpListener(System.Net.IPAddress.Any, 23)[/COLOR]
[COLOR=black]TCPL.Start()[/COLOR]
[/SIZE][/SIZE][SIZE=2][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE]
 
Thank you

That shifted the blue lines. Thank you.

If i am supposed to run these one of these programs on one PC - the client and the other on another pc - the server....should I change these to console applications rather than windows applications?

Thank you once again.

Regards.:)
 
It all depends on what type of program you’re making.

Do you want it to be user friendly, or do you want it to run silently in the background?

Answering this question should help you figure things out.
 
Back
Top