I am a beginner programmer and i would like to start to work with sockets.
I have read tutorials and more and i can't understand.
I want the server to remain open,i mean also if the client is closing the software,the server works, i tried it and faild,and i want the server not only for one client..for at least 50.
can u give me a start of this?
this is the server code which i faild to do the things i wrote.
try
{
TcpListener tcpListener = new TcpListener(5555);
Socket socketForClient = tcpListener.AcceptSocket();
tcpListener.Start();
if (socketForClient.Connected)
{
while (true)
{
Console.WriteLine("Client connected");
}
}
//socketForClient.Close();
//Console.WriteLine("Exiting...");
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
thank you very much guys

New Topic/Question
Reply




MultiQuote






|