// File: enbock[P]Warp10Server/ulib/src/Socket.cpp
// Function: u::Socket::listen()
bool u::Socket::listen()
{
	if(isConnected()) return false;

	lock();
	_con = ::bind(_descriptor, (const struct sockaddr*)_addr, _addrLen);
	unlock();

	if(!isConnected())
	{
		error(className()+"::listen: Socket bind error. ["+int2string(_descriptor)+"]");
		return false; // bind error
	}

	lock();
	_con = ::listen(_descriptor, maxWaitingClients);
	unlock();
	if(!isConnected())
	{
		error(className()+"::listen: Socket listen error. ["+int2string(_descriptor)+"]");
		return false;
	}

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2b0, %rsp            # imm = 0x2B0
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x268(%rbp)
callq 0x41aaf0
testb $0x1, %al
jne 0x41b2c5
jmp 0x41b2ce
movb $0x0, -0x1(%rbp)
jmp 0x41b92d
movq -0x268(%rbp), %rdi
callq 0x417410
movq -0x268(%rbp), %rax
movl 0x34(%rax), %edi
movq 0x48(%rax), %rsi
movl 0x50(%rax), %edx
callq 0x56e150
movq -0x268(%rbp), %rdi
movl %eax, 0x54(%rdi)
callq 0x417380
movq -0x268(%rbp), %rdi
callq 0x41aaf0
testb $0x1, %al
jne 0x41b5ea
movq $0x668b40, %rdi         # imm = 0x668B40
leaq 0x1bfeff(%rip), %rsi    # 0x5db220
callq 0x49dd60
movq %rax, -0x270(%rbp)
movb $0x0, -0xc9(%rbp)
movb $0x0, -0xdd(%rbp)
movb $0x0, -0x139(%rbp)
movb $0x0, -0x13a(%rbp)
movb $0x0, -0x13c(%rbp)
movb $0x1, %al
testb $0x1, %al
jne 0x41b35b
jmp 0x41b3ed
movq -0x268(%rbp), %rsi
movq (%rsi), %rax
movq 0x8(%rax), %rax
leaq -0xc8(%rbp), %rdi
callq *%rax
movb $0x1, -0xc9(%rbp)
leaq -0x90(%rbp), %rsi
leaq 0x1c1102(%rip), %rdx    # 0x5dc489
leaq -0x70(%rbp), %rdi
callq 0x405d00
jmp 0x41b392
movq -0x268(%rbp), %rax
movb $0x1, -0xdd(%rbp)
movl 0x34(%rax), %esi
leaq -0x138(%rbp), %rdi
callq 0x4178a0
jmp 0x41b3b1
movb $0x1, -0x139(%rbp)
leaq -0x100(%rbp), %rdx
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x409d40
jmp 0x41b3ce
movb $0x1, -0x13a(%rbp)
leaq 0x1e55aa(%rip), %rdx    # 0x600986
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x405d00
jmp 0x41b3eb
jmp 0x41b422
leaq -0x13b(%rbp), %rdi
movq %rdi, -0x278(%rbp)
callq 0x435b90
movq -0x278(%rbp), %rdx
movb $0x1, -0x13c(%rbp)
leaq 0x1e558d(%rip), %rsi    # 0x6009a2
leaq -0x30(%rbp), %rdi
callq 0x407e60
jmp 0x41b420
jmp 0x41b422
movq -0x270(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x4b05e0
movq %rax, -0x280(%rbp)
jmp 0x41b43b
movq -0x280(%rbp), %rdi
leaq 0x1bfc87(%rip), %rsi    # 0x5db0d0
callq 0x49dd60
movq %rax, -0x288(%rbp)
jmp 0x41b457
movq -0x288(%rbp), %rdi
movq $0x49d640, %rsi         # imm = 0x49D640
callq 0x49c850
jmp 0x41b46c
leaq -0x30(%rbp), %rdi
callq 0x4adc60
testb $0x1, -0x13c(%rbp)
jne 0x41b480
jmp 0x41b48c
leaq -0x13b(%rbp), %rdi
callq 0x435bb0
testb $0x1, -0x13a(%rbp)
jne 0x41b497
jmp 0x41b4a0
leaq -0x50(%rbp), %rdi
callq 0x4adc60
testb $0x1, -0x139(%rbp)
jne 0x41b4ab
jmp 0x41b4b7
leaq -0x138(%rbp), %rdi
callq 0x405650
testb $0x1, -0xdd(%rbp)
jne 0x41b4c2
jmp 0x41b4cb
leaq -0x70(%rbp), %rdi
callq 0x4adc60
testb $0x1, -0xc9(%rbp)
jne 0x41b4d6
jmp 0x41b4e2
leaq -0xc8(%rbp), %rdi
callq 0x405650
movb $0x0, -0x1(%rbp)
jmp 0x41b92d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x41b5ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x41b5b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x41b59f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x41b589
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x41b570
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x4adc60
testb $0x1, -0x13c(%rbp)
jne 0x41b57b
jmp 0x41b587
leaq -0x13b(%rbp), %rdi
callq 0x435bb0
jmp 0x41b589
testb $0x1, -0x13a(%rbp)
jne 0x41b594
jmp 0x41b59d
leaq -0x50(%rbp), %rdi
callq 0x4adc60
jmp 0x41b59f
testb $0x1, -0x139(%rbp)
jne 0x41b5aa
jmp 0x41b5b6
leaq -0x138(%rbp), %rdi
callq 0x405650
jmp 0x41b5b8
testb $0x1, -0xdd(%rbp)
jne 0x41b5c3
jmp 0x41b5cc
leaq -0x70(%rbp), %rdi
callq 0x4adc60
jmp 0x41b5ce
testb $0x1, -0xc9(%rbp)
jne 0x41b5d9
jmp 0x41b5e5
leaq -0xc8(%rbp), %rdi
callq 0x405650
jmp 0x41b93b
movq -0x268(%rbp), %rdi
callq 0x417410
movq -0x268(%rbp), %rax
movl 0x34(%rax), %edi
movl 0xbc(%rax), %esi
callq 0x56e250
movq -0x268(%rbp), %rdi
movl %eax, 0x54(%rdi)
callq 0x417380
movq -0x268(%rbp), %rdi
callq 0x41aaf0
testb $0x1, %al
jne 0x41b929
movq $0x668b40, %rdi         # imm = 0x668B40
leaq 0x1bfbe4(%rip), %rsi    # 0x5db220
callq 0x49dd60
movq %rax, -0x290(%rbp)
movb $0x0, -0x1f9(%rbp)
movb $0x0, -0x1fa(%rbp)
movb $0x0, -0x259(%rbp)
movb $0x0, -0x25a(%rbp)
movb $0x0, -0x25c(%rbp)
movb $0x1, %al
testb $0x1, %al
jne 0x41b676
jmp 0x41b717
movq -0x268(%rbp), %rsi
movq (%rsi), %rax
movq 0x8(%rax), %rax
leaq -0x1f8(%rbp), %rdi
callq *%rax
movb $0x1, -0x1f9(%rbp)
leaq -0x1c0(%rbp), %rsi
leaq 0x1c0e51(%rip), %rdx    # 0x5dc4f3
leaq -0x1a0(%rbp), %rdi
callq 0x405d00
jmp 0x41b6b0
movq -0x268(%rbp), %rax
movb $0x1, -0x1fa(%rbp)
movl 0x34(%rax), %esi
leaq -0x258(%rbp), %rdi
callq 0x4178a0
jmp 0x41b6cf
movb $0x1, -0x259(%rbp)
leaq -0x220(%rbp), %rdx
leaq -0x180(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x409d40
jmp 0x41b6f2
movb $0x1, -0x25a(%rbp)
leaq 0x1e5286(%rip), %rdx    # 0x600986
leaq -0x160(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x405d00
jmp 0x41b715
jmp 0x41b74f
leaq -0x25b(%rbp), %rdi
movq %rdi, -0x298(%rbp)
callq 0x435b90
movq -0x298(%rbp), %rdx
movb $0x1, -0x25c(%rbp)
leaq 0x1e5263(%rip), %rsi    # 0x6009a2
leaq -0x160(%rbp), %rdi
callq 0x407e60
jmp 0x41b74d
jmp 0x41b74f
movq -0x290(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x4b05e0
movq %rax, -0x2a0(%rbp)
jmp 0x41b76b
movq -0x2a0(%rbp), %rdi
leaq 0x1bf957(%rip), %rsi    # 0x5db0d0
callq 0x49dd60
movq %rax, -0x2a8(%rbp)
jmp 0x41b787
movq -0x2a8(%rbp), %rdi
movq $0x49d640, %rsi         # imm = 0x49D640
callq 0x49c850
jmp 0x41b79c
leaq -0x160(%rbp), %rdi
callq 0x4adc60
testb $0x1, -0x25c(%rbp)
jne 0x41b7b3
jmp 0x41b7bf
leaq -0x25b(%rbp), %rdi
callq 0x435bb0
testb $0x1, -0x25a(%rbp)
jne 0x41b7ca
jmp 0x41b7d6
leaq -0x180(%rbp), %rdi
callq 0x4adc60
testb $0x1, -0x259(%rbp)
jne 0x41b7e1
jmp 0x41b7ed
leaq -0x258(%rbp), %rdi
callq 0x405650
testb $0x1, -0x1fa(%rbp)
jne 0x41b7f8
jmp 0x41b804
leaq -0x1a0(%rbp), %rdi
callq 0x4adc60
testb $0x1, -0x1f9(%rbp)
jne 0x41b80f
jmp 0x41b81b
leaq -0x1f8(%rbp), %rdi
callq 0x405650
movb $0x0, -0x1(%rbp)
jmp 0x41b92d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x41b910
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x41b8f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x41b8de
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x41b8c5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x41b8ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x4adc60
testb $0x1, -0x25c(%rbp)
jne 0x41b8b7
jmp 0x41b8c3
leaq -0x25b(%rbp), %rdi
callq 0x435bb0
jmp 0x41b8c5
testb $0x1, -0x25a(%rbp)
jne 0x41b8d0
jmp 0x41b8dc
leaq -0x180(%rbp), %rdi
callq 0x4adc60
jmp 0x41b8de
testb $0x1, -0x259(%rbp)
jne 0x41b8e9
jmp 0x41b8f5
leaq -0x258(%rbp), %rdi
callq 0x405650
jmp 0x41b8f7
testb $0x1, -0x1fa(%rbp)
jne 0x41b902
jmp 0x41b90e
leaq -0x1a0(%rbp), %rdi
callq 0x4adc60
jmp 0x41b910
testb $0x1, -0x1f9(%rbp)
jne 0x41b91b
jmp 0x41b927
leaq -0x1f8(%rbp), %rdi
callq 0x405650
jmp 0x41b93b
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x2b0, %rsp            # imm = 0x2B0
popq %rbp
retq
movq -0xd8(%rbp), %rdi
callq 0x4deb40
nopw (%rax,%rax)