Hi,
Is your listener socket set to non-blocking? (I guess it's not).
I suggest setting it to non-blocking. Just be prepared to handle error values returned such as: EAGAIN, EWOULDBLOCK etc...
10x,
Tomer.
-----Original Message-----
From: owner-libevent-users@xxxxxxxxxxxxx [mailto:owner-libevent-users@xxxxxxxxxxxxx] On Behalf Of Yucong Sun
Sent: Thursday, December 05, 2013 8:50 AM
To: libevent-users
Subject: Re: [Libevent-users] stuck in my accept call :-(
I would take a blind guess and Âmaybe you need to adjust somaxconn
http://www.freebsd.org/doc/handbook/configtuning-kernel-limits.html
12.14.1.2. kern.ipc.somaxconn
The kern.ipc.somaxconn sysctl(8) variable limits the size of the listen queue for accepting new TCP connections. The default value of
128 is typically too low for robust handling of new connections on a heavily loaded web server. For such environments, it is recommended to increase this value to 1024 or higher. A service such as sendmail(8), or Apache may itself limit the listen queue size, but will often have a directive in its configuration file to adjust the queue size. Large listen queues do a better job of avoiding Denial of Service (DoS) attacks.
On Wed, Dec 4, 2013 at 9:22 PM, sven falempin <sven.falempin@xxxxxxxxx> wrote:
> hello:
>
> libevent-2.0.21-stable
>
> https://forums.freebsd.org/viewtopic.php?f=35&t=43654&p=242811#p242811
>
> event_assign(&serv_sock_evt, evt_base,
> Â Â Â sock, EV_READ | EV_PERSIST,
> Â Â Â server::serv_sock_accept_pattern, this);
> event_add(&serv_sock_evt, NULL);
>
> then i do new in server::serv_sock_accept_pattern and path the
> arguments to accept.
>
> But apparently socket has nothing to accept.
>
> It is not easy to produce....
>
> help/insight welcome.
>
> --
> ----------------------------------------------------------------------
> -----------------------------------------------
> () ascii ribbon campaign - against html e-mail /\
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users  Âin the body.