Subj : Re: multi-threaded server, pthreads & sleep To : comp.unix.programmer,comp.programming.threads From : parahat Date : Thu Mar 17 2005 12:11 am steve@Watt.COM (Steve Watt) wrote in message news:... > In article <5bb6e2ec.0503161548.46b24cdc@posting.google.com>, > Parahat Melayev wrote: > >"David Schwartz" wrote in message > >news:... > >> "Parahat Melayev" wrote in message > >> news:5bb6e2ec.0503161125.5d63e85f@posting.google.com... > >> > >> > yes I programmed using select firstly, actually. but it is not doing > >> > what it is supposed to do, when I connect 1000 client at once. > >> > >> You're going to have to get more sophisticated if you want to handle > >> more than a few hundred concurrent connections. You'll at minimum need to > >> use 'poll' instead of 'select'. You may need to raise resource limits also. > >> It's hard to know exactly what your issue is because "it is not doing what > >> it is supposed to do" is a very vague description of the problem. > > > >Here is simple server code using epoll. but I am again facing some problems here. > > > >- I can recv from events[i].data.fd but I can't send any data over > >events[i].data.fd > > And you don't ever allocate events[]; it's declared as a pointer, but > you never allocate memory. yes! thanks. but still I can recv from events[i].data.fd but I can't send any data over events[i].data.fd > > >- When I make multiple connections at once (say 100) I get segmentation > >fault... > > I'd expect that segfault rather sooner than 100, you're lucky to > be getting that far. .