my->bio.read = fr_bio_null_read;
my->bio.write = fr_bio_null_write;
- /*
- * @todo - make the backlog configurable.
- */
- if (listen(my->info.socket.fd, 8) < 0) {
+ if (listen(my->info.socket.fd, my->info.cfg->backlog_is_set ? my->info.cfg->backlog : 8) < 0) {
fr_strerror_printf("Failed calling listen() %s", fr_syserror(errno));
return fr_bio_error(IO);
}
char const *interface; //!< for binding to an interface
+ uint32_t backlog; //!< for listen()
+
uint32_t recv_buff; //!< How big the kernel's receive buffer should be.
uint32_t send_buff; //!< How big the kernel's send buffer should be.
*/
bool recv_buff_is_set; //!< Whether we were provided with a recv_buf
bool send_buff_is_set; //!< Whether we were provided with a send_buf
+ bool backlog_is_set; //!< Whether we were provided with a backlog
} fr_bio_fd_config_t;
extern const conf_parser_t fr_bio_fd_client_config[];
{ FR_CONF_OFFSET("interface", fr_bio_fd_config_t, interface) },
+ { FR_CONF_OFFSET_IS_SET("backlog", FR_TYPE_UINT32, 0, fr_bio_fd_config_t, backlog) },
+
{ FR_CONF_OFFSET_IS_SET("recv_buff", FR_TYPE_UINT32, 0, fr_bio_fd_config_t, recv_buff) },
{ FR_CONF_OFFSET_IS_SET("send_buff", FR_TYPE_UINT32, 0, fr_bio_fd_config_t, send_buff) },