Hi there
I'm just new to socket programming and my new work forces me to have
immediate proficiency with it. I am currently reading Beej's tutorials
and hopefully finish it ASAP. But I have few questions to ask first:
1) can a multithreaded server be able to handle 1600 clients
concurrently using TCP connections? If not how many? I need to create
a prototype server and benchmark how many connections it can have? I
have found a source here: http://cs.ecs.baylor.edu/~donahoo/pr.../textcode.html
I used the ff. sources:
HandleTCPClient.c
CreateTCPServerSocket.c
AcceptTCPConnection.c
TCPEchoServer-Thread.c

Basically from what I have understand, I will just customize the
HandleTCPClient.c for what I need. Is the code really all I need?

2) The second problem is how can I simulate about 1600 clients
connecting concurrently to the server? I found a code in a book, i
forgot the title (something like Unix Socket Programming), a TCP
client can "spawn" connections using fork to benchmark different
socket programming approach (ie. fork, threading, pre-threading, etc).
However I always got an error if I i spawn about 15 children. I really
don't know if the problem is with the client or with the server. I
found it weird, when i run the server in one box and 2 clients (same
box and another one) with 10 child spawns, the program ended without
an error. However if I run the server and run 1 client with 15 spawn
(either in the same box or another) I encounter "cannot allocate
memory", basically having problems with pthread_create(). Does anyone
have another client program that can simulate multiple connections? Or
any suggestions on how to test the server's load?

Sorry for bothering but I really need help. Thanks in advance!