You are not logged in.

#1 2010-06-19 09:22:12

zqyking
Member
From: HongKong
Registered: 2010-05-19
Posts: 29

[C] please show me a epool with sokcet server example

i want to write a socket server with epool using c  language
but , not have good logic example..


please show me your code..

thanks............

Last edited by zqyking (2010-06-19 09:51:11)

Offline

#2 2010-06-19 19:27:45

saline
Member
Registered: 2010-02-20
Posts: 86

Re: [C] please show me a epool with sokcet server example

'man 7 epoll' has an example in it.

Offline

#3 2010-06-22 03:29:55

zqyking
Member
From: HongKong
Registered: 2010-05-19
Posts: 29

Re: [C] please show me a epool with sokcet server example

saline wrote:

'man 7 epoll' has an example in it.

thanks.

Offline

#4 2010-06-30 12:03:35

b52
Member
From: Germany
Registered: 2009-03-20
Posts: 49
Website

Re: [C] please show me a epool with sokcet server example

Hey

if your still interested in this topic ...
a few month ago i was in the mood to create a threaded epool server
it should handle a lot of connections with a pool pool of worker threads
the base code works just fine:
http://github.com/b52/trash/blob/master/server.c

greets b52


srsly?

Offline

#5 2010-06-30 13:09:09

Themaister
Member
From: Trondheim, Norway
Registered: 2008-07-21
Posts: 652
Website

Re: [C] please show me a epool with sokcet server example

Nice code. Very simple to read through smile Is there a good reason to use epoll over e.g. poll() when you're not handling a very large number of clients?

Offline

#6 2010-06-30 16:46:25

b52
Member
From: Germany
Registered: 2009-03-20
Posts: 49
Website

Re: [C] please show me a epool with sokcet server example

Nice to you hear you like me code big_smile
Generally I would use epoll over poll, cause it scales very good for a large amount of connections but has a lower load as well with only few connections.
Besides its quite easy to work with epoll, give it a go!


srsly?

Offline

#7 2010-07-10 20:41:30

gwpl
Member
From: Warsaw, Poland
Registered: 2010-07-10
Posts: 35

Re: [C] please show me a epool with sokcet server example

I know question was about epool. But maybe libevent ?  http://monkey.org/~provos/libevent/

Offline

Board footer

Powered by FluxBB