// File: /workspace/github_cpp_makefile_star2_O3/guoxuanhan[P]NetServer/tcpserver.cpp
// Function: TcpServer::TcpServer(EventLoop*, int, int)
TcpServer::TcpServer(EventLoop* loop, const int port, const int threadnum)
    : serversocket_(),
    loop_(loop),
    serverchannel_(),
    conncount_(0),
    eventloopthreadpool(loop, threadnum)
{
    //serversocket_.SetSocketOption();
    serversocket_.SetReuseAddr();
    serversocket_.BindAddress(port);
    serversocket_.Listen();
    serversocket_.Setnonblocking();

    serverchannel_.SetFd(serversocket_.fd());
    serverchannel_.SetReadHandle(std::bind(&TcpServer::OnNewConnection, this));
    serverchannel_.SetErrorHandle(std::bind(&TcpServer::OnConnectionError, this));

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %r12d
movl %edx, %ebp
movq %rsi, %r13
movq %rdi, %rbx
callq 0xbae8
movq %r13, 0x8(%rbx)
leaq 0x10(%rbx), %r14
movq %r14, %rdi
callq 0x4b1c
xorl %eax, %eax
movl %eax, 0x98(%rbx)
leaq 0xa8(%rbx), %rcx
movl %eax, 0xa8(%rbx)
movq $0x0, 0xb0(%rbx)
movq %rcx, 0xb8(%rbx)
movq %rcx, 0xc0(%rbx)
leaq 0xf8(%rbx), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0xc8(%rbx)
movups %xmm0, 0xd8(%rbx)
movups %xmm0, 0xe8(%rbx)
movq %r15, %rdi
movq %r13, %rsi
movl %r12d, %edx
callq 0x61d8
leaq 0x128(%rbx), %r12
movl $0xa0, %edx
movq %r12, %rdi
xorl %esi, %esi
callq 0x41f0
movq %rbx, %rdi
callq 0xbbbc
movq %rbx, %rdi
movl %ebp, %esi
callq 0xbc5e
movq %rbx, %rdi
callq 0xbcec
movq %rbx, %rdi
callq 0xbbe2
movl (%rbx), %esi
movq %r14, %rdi
callq 0x4bba
movq $0x0, 0x10(%rsp)
movl $0x18, %edi
callq 0x4350
leaq 0x1e7(%rip), %rcx       # 0xd62c
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq %rbx, 0x10(%rax)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x80f(%rip), %r13       # 0xdc72
movq %r13, 0x18(%rsi)
leaq 0x820(%rip), %rbp       # 0xdc8e
movq %rbp, 0x10(%rsi)
movq %r14, %rdi
callq 0x4d64
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0xd493
leaq 0x8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq $0x0, 0x10(%rsp)
movl $0x18, %edi
callq 0x4350
leaq 0x4d7(%rip), %rcx       # 0xd984
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq %rbx, 0x10(%rax)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r13, 0x18(%rsi)
movq %rbp, 0x10(%rsi)
movq %r14, %rdi
callq 0x4d78
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0xd4ed
leaq 0x8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd624
jmp 0xd624
movq %rax, %r13
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0xd563
leaq 0x8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0xd563
jmp 0xd624
jmp 0xd560
movq %rax, %r13
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0xd563
leaq 0x8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0xd563
jmp 0xd624
jmp 0xd560
movq %rax, %r13
jmp 0xd5f8
movq %rax, %r13
jmp 0xd60c
movq %rax, %r13
movq 0x1b8(%rbx), %rax
testq %rax, %rax
je 0xd580
leaq 0x1a8(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x198(%rbx), %rax
testq %rax, %rax
je 0xd59d
leaq 0x188(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x178(%rbx), %rax
testq %rax, %rax
je 0xd5ba
leaq 0x168(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x158(%rbx), %rax
testq %rax, %rax
je 0xd5d7
leaq 0x148(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x138(%rbx), %rax
testq %rax, %rax
je 0xd5f0
movq %r12, %rdi
movq %r12, %rsi
movl $0x3, %edx
callq *%rax
movq %r15, %rdi
callq 0x627a
leaq 0xa0(%rbx), %rdi
callq 0xdbfe
movq %r14, %rdi
callq 0x4b46
movq %rbx, %rdi
callq 0xbb62
movq %r13, %rdi
callq 0x45a0
jmp 0xd624
jmp 0xd624
jmp 0xd624
jmp 0xd624
movq %rax, %rdi
callq 0x4df2