tags:

views:

29

answers:

1

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);

A: 

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.

Itay
My socket backlog is 100 in listening. I to need to increase or decrease.
Siva CCSPL
Example: socket.Listen(100)
Siva CCSPL
if your backlog is 100 and you got only 10-15 connections this is not the problem.
Itay
ok, then give me a solution.
Siva CCSPL
all clients are to connect automatic
Siva CCSPL