1
votes

I have an problem in socket connection

I had client and Server application, the server application to listern an a particular port.

500 clients are to connected and send the data to process everything fine.

At particular time i closed all clients and also close the server. when i start server after 10 mins at before 2 mins start all clients, very few clients(5-15) are connected. give me a solution.

mainSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); endpoint = new IPEndPoint(IPAddress.Any, int.Parse(txt_server_port.Text)); mainSocket.Bind(endpoint); mainSocket.Listen(100); mainSocket.BeginAccept(new AsyncCallback(ConnetedClient), mainSocket);

1
You gotto show us the code, man. We need the code. Show us the code! :)jgauffin
You probably have a timeout set on TcpListener, so when timeout expires, no clients can be connected... You should definitely add some code to your question...Cipi
mainSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); endpoint = new IPEndPoint(IPAddress.Any, int.Parse(txt_server_port.Text)); mainSocket.Bind(endpoint); mainSocket.Listen(100); mainSocket.BeginAccept(new AsyncCallback(ConnetedClient), mainSocket);Siva CCSPL
just using a asychnorous socketsSiva CCSPL
all clients are to connect automaticSiva CCSPL

1 Answers

0
votes

If all your clients are trying to connect together it might be that the listener backlog got filled.
You can increase the backlog in the parameter passed to the Listen method.