Ignore:
Timestamp:
Jun 8, 2022, 7:07:51 PM (2 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
bbf61838
Parents:
6e2b04e
Message:

First draft at acceptor thread webserver

File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/io/http/socket.cfa

    r6e2b04e r7f0ac12  
    2626
    2727int listener(struct sockaddr_in & address, int addrlen) {
    28         int sockfd = socket(AF_INET, SOCK_STREAM, 0);
     28        int type = SOCK_STREAM;
     29        if(options.socket.reuseport) type |= SOCK_NONBLOCK;
     30        int sockfd = socket(AF_INET, type, 0);
    2931        if(sockfd < 0) {
    3032                abort( "socket error: (%d) %s\n", (int)errno, strerror(errno) );
    3133        }
    3234
    33         if(options.socket.onereuse || options.socket.manyreuse) {
     35        if(options.socket.reuseport) {
    3436                int value = 1;
    3537                // if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (const void*)&on, sizeof(on)))
Note: See TracChangeset for help on using the changeset viewer.