// File: guoxuanhan[P]NetServer/echoserver.cpp
// Function: EchoServer::EchoServer(EventLoop*, int, int)
EchoServer::EchoServer(EventLoop* loop, const int port, const int threadnum)
    : tcpserver_(loop, port, threadnum)
{
    tcpserver_.SetNewConnCallback(std::bind(&EchoServer::HandleNewConnection, this, std::placeholders::_1));
    tcpserver_.SetMessageCallback(std::bind(&EchoServer::HandleMessage, this, std::placeholders::_1, std::placeholders::_2));
    tcpserver_.SetSendCompleteCallback(std::bind(&EchoServer::HandleSendComplete, this, std::placeholders::_1));
    tcpserver_.SetCloseCallback(std::bind(&EchoServer::HandleClose, this, std::placeholders::_1));
    tcpserver_.SetErrorCallback(std::bind(&EchoServer::HandleError, this, std::placeholders::_1));
}

// Assembly:
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rdi, 0x1f0(%rsp)
movq %rsi, 0x1e8(%rsp)
movl %edx, 0x1e4(%rsp)
movl %ecx, 0x1e0(%rsp)
movq 0x1f0(%rsp), %rdi
movq %rdi, 0x38(%rsp)
movq %rdi, %rax
movq %rax, 0x28(%rsp)
movq %rdi, %rax
movq %rax, 0x30(%rsp)
movq 0x1e8(%rsp), %rsi
movl 0x1e4(%rsp), %edx
movl 0x1e0(%rsp), %ecx
callq 0x1f190
movq 0x38(%rsp), %rax
leaq 0x387(%rip), %rcx       # 0x6610
movq %rcx, 0x198(%rsp)
movq $0x0, 0x1a0(%rsp)
movq %rax, 0x190(%rsp)
movq 0x34cec(%rip), %rcx     # 0x3af98
leaq 0x1a8(%rsp), %rdi
leaq 0x198(%rsp), %rsi
leaq 0x190(%rsp), %rdx
callq 0x67d0
jmp 0x62cb
leaq 0x1c0(%rsp), %rdi
leaq 0x1a8(%rsp), %rsi
callq 0x6810
jmp 0x62e2
movq 0x38(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0x67a0
jmp 0x62f6
leaq 0x1c0(%rsp), %rdi
callq 0x68c0
movq 0x28(%rsp), %rax
movq %rax, %rcx
movq %rcx, 0x20(%rsp)
leaq 0x339(%rip), %rcx       # 0x6650
movq %rcx, 0x138(%rsp)
movq $0x0, 0x140(%rsp)
movq %rax, 0x130(%rsp)
movq 0x34c5e(%rip), %rcx     # 0x3af98
movq 0x34caf(%rip), %r8      # 0x3aff0
leaq 0x148(%rsp), %rdi
leaq 0x138(%rsp), %rsi
leaq 0x130(%rsp), %rdx
callq 0x6900
jmp 0x6360
leaq 0x160(%rsp), %rdi
leaq 0x148(%rsp), %rsi
callq 0x6950
jmp 0x6377
movq 0x20(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x68d0
jmp 0x638b
leaq 0x160(%rsp), %rdi
callq 0x6a00
movq 0x28(%rsp), %rax
movq %rax, %rcx
movq %rcx, 0x18(%rsp)
leaq 0x344(%rip), %rcx       # 0x66f0
movq %rcx, 0xe8(%rsp)
movq $0x0, 0xf0(%rsp)
movq %rax, 0xe0(%rsp)
movq 0x34bc9(%rip), %rcx     # 0x3af98
leaq 0xf8(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0xe0(%rsp), %rdx
callq 0x67d0
jmp 0x63ee
leaq 0x110(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x6810
jmp 0x6405
movq 0x18(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x6a10
jmp 0x6419
leaq 0x110(%rsp), %rdi
callq 0x68c0
movq 0x28(%rsp), %rax
movq %rax, %rcx
movq %rcx, 0x10(%rsp)
leaq 0x2c6(%rip), %rcx       # 0x6700
movq %rcx, 0x98(%rsp)
movq $0x0, 0xa0(%rsp)
movq %rax, 0x90(%rsp)
movq 0x34b3b(%rip), %rcx     # 0x3af98
leaq 0xa8(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x67d0
jmp 0x647c
leaq 0xc0(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x6810
jmp 0x6493
movq 0x10(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x6a40
jmp 0x64a7
leaq 0xc0(%rsp), %rdi
callq 0x68c0
movq 0x28(%rsp), %rax
movq %rax, %rcx
movq %rcx, 0x8(%rsp)
leaq 0x278(%rip), %rcx       # 0x6740
movq %rcx, 0x48(%rsp)
movq $0x0, 0x50(%rsp)
movq %rax, 0x40(%rsp)
movq 0x34ab6(%rip), %rcx     # 0x3af98
leaq 0x58(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x67d0
jmp 0x64f8
leaq 0x70(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x6810
jmp 0x6509
movq 0x8(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x6a70
jmp 0x651a
leaq 0x70(%rsp), %rdi
callq 0x68c0
addq $0x1f8, %rsp            # imm = 0x1F8
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
jmp 0x65f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
leaq 0x1c0(%rsp), %rdi
callq 0x68c0
jmp 0x65f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
leaq 0x160(%rsp), %rdi
callq 0x6a00
jmp 0x65f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
leaq 0x110(%rsp), %rdi
callq 0x68c0
jmp 0x65f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x68c0
jmp 0x65f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x68c0
movq 0x30(%rsp), %rdi
callq 0x1f8c0
movq 0x188(%rsp), %rdi
callq 0x5660
nopl (%rax)