[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[Libevent-users] listen syscall and the backlog argument



Hi,

In listener.c, there is some duplicated code related to listen() and the
backlog argument.

This code simplifies backlog handling by relying on the POSIX semantics
of listen().
In evconnlistener_new and evconnlistener_new_async, if the backlog
argument was negative, a hardcoded backlog of 128 was used. POSIX
specifies that the queue is set to an implementation defined value if
the backlog is negative which we can then use to simplify the handling.
On my Linux system, this results in a queue size of 128 anyway.

In evconnlistener_new_bind, an error was returned if the backlog is 0.
This fixes it so that it has the POSIX semantics where a backlog of 0
behaves the same as a negative backlog.

Cheers
Ross

==========================================================
The following changes since commit bf2c5a77973262e599a7d5a6604e4f3d43718119:

  Also make win32select.c conditional for IDE users (2012-02-10 23:56:49
-0500)

are available in the git repository at:
  git@xxxxxxxxxx:rosslagerwall/libevent.git backlog

Ross Lagerwall (1):
      Simplify backlog handling by relying on the POSIX semantics of
listen().

 include/event2/listener.h |    4 ++--
 listener.c                |   13 +++----------
 2 files changed, 5 insertions(+), 12 deletions(-)

Attachment: signature.asc
Description: OpenPGP digital signature