Click here to Skip to main content
15,065,783 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
ok so i have a problem where like that its working(on ipv4 address and local address):
IPAddress ipaLocal = ipAddress;
tlsClient = new TcpListener(1986);

and like that its not working on ipv4 address:
int port = 1986;
IPAddress ipaLocal = ipAddress;
tlsClient = new TcpListener(ipaLocal,port);

its because its not suppose to work with ipv4 address and with only local address?
and another thing is that i made is that you can close your server and relisten to clients without close the app but there is an error where its says: "only usage of each socket address is allowed", i checked in all the code and found nothing that have been left open.
thank for your time and help!!
the code:[C#] chat server -[^]
its based on a chat that i found on the internet.

What I have tried:
Updated 22-Jun-16 18:36pm

1 solution

only local address:
var tcpListener = new TcpListener(IPAddress.Parse(""), 1986);

or working on any IPv4 address:
var tcpListener = new TcpListener(IPAddress.Any, 1986);
Member 12181103 23-Jun-16 4:20am
but then how can i know what is the ip?
like how i set my own ip?
and what about my second problem?
ty for help!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900