// File: enbock[P]Warp10Server/warp10server/src/Network/WebListener.cpp
// Function: Warp10::Network::WebListener::checkClosed()
void WebListener::checkClosed()
{
	lock();
	int64 count   = _connections.length();
	bool isClosed = _isClosed;
	unlock();
	trace(
		className() + "::checkClosed: " + int2string(count)
		+ " connection left and socket is " 
		+ (isClosed == false ? "connected" : "disconnected")
		+ "."
	);
	if(
		count == 0 && isClosed == true
		&& hasEventListener(WebEvent::WILL_CLOSE) == false
	) {
		lock(); // sync canClose and connection closed here
		bool sent = _closeSent;
		_closeSent = true;
		unlock();
		if (sent  == false) {
			u::Network::Event closed(u::Network::Event::CLOSED);
			dispatchEvent(&closed);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x270, %rsp            # imm = 0x270
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x250(%rbp)
callq 0x417410
movq -0x250(%rbp), %rdi
addq $0x98, %rdi
callq 0x40dc90
movq -0x250(%rbp), %rdi
movq %rax, -0x10(%rbp)
movb 0xe8(%rdi), %al
andb $0x1, %al
movb %al, -0x11(%rbp)
callq 0x417380
movq $0x668c60, %rdi         # imm = 0x668C60
leaq 0x1ce7c6(%rip), %rsi    # 0x5db091
callq 0x49dd60
movq %rax, -0x248(%rbp)
movb $0x0, -0x111(%rbp)
movb $0x0, -0x125(%rbp)
movb $0x0, -0x181(%rbp)
movb $0x0, -0x182(%rbp)
movb $0x0, -0x183(%rbp)
movb $0x0, -0x184(%rbp)
movb $0x0, -0x186(%rbp)
movb $0x1, %al
testb $0x1, %al
jne 0x40c913
jmp 0x40c9f5
movq -0x250(%rbp), %rsi
movq (%rsi), %rax
movq 0x8(%rax), %rax
leaq -0x110(%rbp), %rdi
callq *%rax
movb $0x1, -0x111(%rbp)
leaq -0xd8(%rbp), %rsi
leaq 0x1cf069(%rip), %rdx    # 0x5db9a8
leaq -0xb8(%rbp), %rdi
callq 0x405d00
jmp 0x40c94d
movb $0x1, -0x125(%rbp)
movl -0x10(%rbp), %esi
leaq -0x180(%rbp), %rdi
callq 0x4178a0
jmp 0x40c965
movb $0x1, -0x181(%rbp)
leaq -0x148(%rbp), %rdx
leaq -0x98(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x409d40
jmp 0x40c988
movb $0x1, -0x182(%rbp)
leaq 0x1cf022(%rip), %rdx    # 0x5db9b8
leaq -0x78(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x405d00
jmp 0x40c9a8
movb $0x1, -0x183(%rbp)
movb -0x11(%rbp), %cl
leaq 0x1cf01f(%rip), %rax    # 0x5db9d8
leaq 0x1cf01b(%rip), %rdx    # 0x5db9db
testb $0x1, %cl
cmovneq %rax, %rdx
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x405d00
jmp 0x40c9d6
movb $0x1, -0x184(%rbp)
leaq 0x1d7a29(%rip), %rdx    # 0x5e440d
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x405d00
jmp 0x40c9f3
jmp 0x40ca2a
leaq -0x185(%rbp), %rdi
movq %rdi, -0x258(%rbp)
callq 0x435b90
movq -0x258(%rbp), %rdx
movb $0x1, -0x186(%rbp)
leaq 0x1f3f85(%rip), %rsi    # 0x6009a2
leaq -0x38(%rbp), %rdi
callq 0x407e60
jmp 0x40ca28
jmp 0x40ca2a
movq -0x248(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x4b05e0
movq %rax, -0x260(%rbp)
jmp 0x40ca43
movq -0x260(%rbp), %rdi
leaq 0x1ce67f(%rip), %rsi    # 0x5db0d0
callq 0x49dd60
movq %rax, -0x268(%rbp)
jmp 0x40ca5f
movq -0x268(%rbp), %rdi
movq $0x49d640, %rsi         # imm = 0x49D640
callq 0x49c850
jmp 0x40ca74
leaq -0x38(%rbp), %rdi
callq 0x4adc60
testb $0x1, -0x186(%rbp)
jne 0x40ca88
jmp 0x40ca94
leaq -0x185(%rbp), %rdi
callq 0x435bb0
testb $0x1, -0x184(%rbp)
jne 0x40ca9f
jmp 0x40caa8
leaq -0x58(%rbp), %rdi
callq 0x4adc60
testb $0x1, -0x183(%rbp)
jne 0x40cab3
jmp 0x40cabc
leaq -0x78(%rbp), %rdi
callq 0x4adc60
testb $0x1, -0x182(%rbp)
jne 0x40cac7
jmp 0x40cad3
leaq -0x98(%rbp), %rdi
callq 0x4adc60
testb $0x1, -0x181(%rbp)
jne 0x40cade
jmp 0x40caea
leaq -0x180(%rbp), %rdi
callq 0x405650
testb $0x1, -0x125(%rbp)
jne 0x40caf5
jmp 0x40cb01
leaq -0xb8(%rbp), %rdi
callq 0x4adc60
testb $0x1, -0x111(%rbp)
jne 0x40cb0c
jmp 0x40cb18
leaq -0x110(%rbp), %rdi
callq 0x405650
cmpq $0x0, -0x10(%rbp)
jne 0x40cd54
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x40cd54
movq -0x250(%rbp), %rdi
movq $0x6677e0, %rsi         # imm = 0x6677E0
callq 0x4127d0
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x40cd54
movq -0x250(%rbp), %rdi
callq 0x417410
movq -0x250(%rbp), %rdi
movb 0xe9(%rdi), %al
andb $0x1, %al
movb %al, -0x187(%rbp)
movb $0x1, 0xe9(%rdi)
callq 0x417380
movb -0x187(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x40cd52
movq $0x667c80, %rsi         # imm = 0x667C80
leaq -0x240(%rbp), %rdi
movq %rdi, -0x270(%rbp)
callq 0x41fd30
movq -0x250(%rbp), %rdi
movq -0x270(%rbp), %rsi
callq 0x412820
jmp 0x40cbc5
leaq -0x240(%rbp), %rdi
callq 0x41fee0
jmp 0x40cd52
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x40cd19
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x40cd00
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x40cce7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x40ccce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x40ccb8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x40cca2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x40cc89
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x4adc60
testb $0x1, -0x186(%rbp)
jne 0x40cc94
jmp 0x40cca0
leaq -0x185(%rbp), %rdi
callq 0x435bb0
jmp 0x40cca2
testb $0x1, -0x184(%rbp)
jne 0x40ccad
jmp 0x40ccb6
leaq -0x58(%rbp), %rdi
callq 0x4adc60
jmp 0x40ccb8
testb $0x1, -0x183(%rbp)
jne 0x40ccc3
jmp 0x40cccc
leaq -0x78(%rbp), %rdi
callq 0x4adc60
jmp 0x40ccce
testb $0x1, -0x182(%rbp)
jne 0x40ccd9
jmp 0x40cce5
leaq -0x98(%rbp), %rdi
callq 0x4adc60
jmp 0x40cce7
testb $0x1, -0x181(%rbp)
jne 0x40ccf2
jmp 0x40ccfe
leaq -0x180(%rbp), %rdi
callq 0x405650
jmp 0x40cd00
testb $0x1, -0x125(%rbp)
jne 0x40cd0b
jmp 0x40cd17
leaq -0xb8(%rbp), %rdi
callq 0x4adc60
jmp 0x40cd19
testb $0x1, -0x111(%rbp)
jne 0x40cd24
jmp 0x40cd30
leaq -0x110(%rbp), %rdi
callq 0x405650
jmp 0x40cd5d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x41fee0
jmp 0x40cd5d
jmp 0x40cd54
addq $0x270, %rsp            # imm = 0x270
popq %rbp
retq
movq -0x120(%rbp), %rdi
callq 0x4deb40
nopl (%rax)