tcp.h, opt.h, api.h, api_msg.h, tcp.c, tcp_in.c, api_lib.c, api_msg.c, sockets.c, init.c: task #7252: Implement TCP listen backlog: Warning: raw API applications have to call 'tcp_accepted(pcb)' in their accept callback to keep accepting new connections.

This commit is contained in:
goldsimon
2007-12-21 16:47:56 +00:00
parent 48e62e25e9
commit 1ed34774c8
11 changed files with 93 additions and 11 deletions

View File

@@ -430,15 +430,15 @@ lwip_listen(int s, int backlog)
struct lwip_socket *sock;
err_t err;
/* This does no harm. If debugging is off, backlog is unused. */
LWIP_UNUSED_ARG(backlog);
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_listen(%d, backlog=%d)\n", s, backlog));
LWIP_ASSERT("backlog must be between 0 and 255", backlog > 0);
LWIP_ASSERT("backlog must be between 0 and 255", backlog <= 0xff);
sock = get_socket(s);
if (!sock)
return -1;
err = netconn_listen(sock->conn);
err = netconn_listen_with_backlog(sock->conn, backlog);
if (err != ERR_OK) {
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_listen(%d) failed, err=%d\n", s, err));