Note that there are some explanatory texts on larger screens.

plurals
  1. POMultiple clients with Server Application more than 15 clients handling issue
    primarykey
    data
    text
    <p>I have a Server Application written in C# .NET and running on Windows XP SP3.</p> <p>I am using asynchronous sockets programming for handling around 500 clients.</p> <p>But I got a problem to entertain more than 15 client connections.</p> <p>My application got shut down when 1 more client connected after 15 clients; I am not understanding whether the problem is with my OS or is a tcp connection limitation problem in Windows XP.</p> <p>Please help to solve out this issue, please suggest any solution.</p> <h3>Update:</h3> <p>Here is my piece of code. </p> <pre><code>public const int MAX_CLIENTS = 200; public AsyncCallback pfnWorkerCallBack; private Socket[] m_workerSocket = new Socket[MAX_CLIENTS]; // class for worker socket &amp; callback method &amp; data buffer private SocketPacket[] m_workerSocketPkt = new SocketPacket[MAX_CLIENTS]; // page Load m_mainSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); IPEndPoint ipLocal = new IPEndPoint(IPAddress.Any, 4321); // Bind to local IP Address... m_mainSocket.Bind(ipLocal); // Start listening... m_mainSocket.Listen(MAX_CLIENTS); m_mainSocket.BeginAccept(new AsyncCallback(OnClientConnect), null); // called when client is connected public void OnClientConnect(IAsyncResult asyn) { try { m_clientCount = setclient(); SocketPacket abc = new SocketPacket(); m_workerSocketPkt[m_clientCount] = abc; //assigning with SocketPacket class m_workerSocketPkt[m_clientCount].m_currentSocket = m_mainSocket.EndAccept(asyn); //transferring connection to other thread m_workerSocketPkt[m_clientCount].m_clientCount = m_clientCount; m_workerSocketPkt[m_clientCount].templist = abcde; //assigning Amj (list) class m_workerSocket[m_clientCount] = m_workerSocketPkt[m_clientCount].m_currentSocket; pfnWorkerCallBack = new AsyncCallback(m_workerSocketPkt[m_clientCount].OnDataReceived); //defining AsynCallBack function for the accepted socket m_workerSocketPkt[m_clientCount].oldpfnWorkerCallBack = pfnWorkerCallBack; m_workerSocketPkt[m_clientCount].data_rec = false; m_workerSocketPkt[m_clientCount].data_sent = false; m_workerSocketPkt[m_clientCount].m_currentSocket.BeginReceive( m_workerSocketPkt[m_clientCount].dataBuffer, //assigning data buffer for receiving for the socket 0, //assigning data buffer offset for receiving for the socket m_workerSocketPkt[m_clientCount].dataBuffer.Length, //assigning maximum data length for receiving for the socket SocketFlags.None, //socket flags pfnWorkerCallBack, //AysnCallBack delegate m_workerSocketPkt[m_clientCount].m_currentSocket //state ); m_mainSocket.BeginAccept(new AsyncCallback(OnClientConnect), null); //start invitation for other new sockets } </code></pre> <p>The Max Client Value is here 200 and worker sockets also, so it should handle 200 clients but I think it's creating a problem in receiving data from more than 15 clients because every client that is connected is continuously connected and sends data to the server.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload