// File: mh0fm4[P]SCDC/src/components/node/node_tcp.cc
// Function: scdc_nodeconn_tcp::open(char const*)
bool scdc_nodeconn_tcp::open(const char *authority)
{
  SCDC_TRACE("open: connect to '" << authority << "'");

  stringlist sl(':', authority);

  string host = sl.front_pop();
  if (host.size() <= 0) host = NODE_TCP_HOST_DEFAULT;

  int port = NODE_TCP_PORT_DEFAULT;

  if (sl.size() >= 1)
  {
    sscanf(sl.front_pop().c_str(), "%d", &port);
  }

  scdc_transport_tcp *transport_tcp = static_cast<scdc_transport_tcp *>(transport);

  transport_connection = transport_tcp->connect(host.c_str(), port);

  if (!transport_connection)
  {
    SCDC_FAIL("open: connect failed!");
    return false;
  }

  transport_connection->on_idle_handler = scdc_nodeconn_on_idle_close_handler;
  transport_connection->on_idle_data = this;

  return scdc_nodeconn::open(authority);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xa8(%rbp)
jmp 0x947f0
movq -0x18(%rbp), %rdx
leaq -0x40(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
movl $0x3a, %esi
movq $-0x1, %rcx
callq 0x25a70
movq -0xb0(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x25b00
jmp 0x94822
leaq -0x60(%rbp), %rdi
callq 0xc460
cmpq $0x0, %rax
ja 0x94870
leaq 0x14fa5(%rip), %rsi     # 0xa97dd
leaq -0x60(%rbp), %rdi
callq 0xc920
jmp 0x94843
jmp 0x94870
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x94a85
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0xc3e0
jmp 0x94a85
movl $0x5cdc, -0x70(%rbp)    # imm = 0x5CDC
leaq -0x40(%rbp), %rdi
callq 0x25ae0
movq %rax, -0xb8(%rbp)
jmp 0x94889
movq -0xb8(%rbp), %rax
cmpq $0x1, %rax
jb 0x948d5
leaq -0x90(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x25b00
jmp 0x948a8
leaq -0x90(%rbp), %rdi
callq 0xc260
movq %rax, %rdi
leaq 0x14eb5(%rip), %rsi     # 0xa9773
leaq -0x70(%rbp), %rdx
movb $0x0, %al
callq 0xc640
leaq -0x90(%rbp), %rdi
callq 0xc3e0
movq -0xa8(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0xc8(%rbp)
leaq -0x60(%rbp), %rdi
callq 0xc260
movq -0xc8(%rbp), %rdi
movq %rax, %rsi
movl -0x70(%rbp), %edx
movq (%rdi), %rax
movq 0x100(%rax), %rax
callq *%rax
movq %rax, -0xc0(%rbp)
jmp 0x94920
movq -0xa8(%rbp), %rax
movq -0xc0(%rbp), %rcx
movq %rcx, 0x70(%rax)
cmpq $0x0, 0x70(%rax)
jne 0x94a21
jmp 0x9493f
leaq 0x3fd62(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x257e0
movq %rax, -0xd0(%rbp)
jmp 0x94957
movq -0xd0(%rbp), %rax
cmpq $0x0, %rax
je 0x94a0d
leaq 0x3fd39(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x25800
jmp 0x94979
leaq 0x3fd28(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x257e0
movq %rax, -0xd8(%rbp)
jmp 0x94991
movq -0xd8(%rbp), %rdi
leaq 0x11811(%rip), %rsi     # 0xa61b0
callq 0xc670
movq %rax, -0xe0(%rbp)
jmp 0x949ad
movq -0xe0(%rbp), %rdi
leaq 0x14d52(%rip), %rsi     # 0xa970d
callq 0xc670
movq %rax, -0xe8(%rbp)
jmp 0x949c9
movq -0xe8(%rbp), %rdi
leaq 0x14e10(%rip), %rsi     # 0xa97e7
callq 0xc670
movq %rax, -0xf0(%rbp)
jmp 0x949e5
movq -0xf0(%rbp), %rdi
movq 0x3f5cd(%rip), %rsi     # 0xd3fc0
callq 0xc6d0
jmp 0x949fa
leaq 0x3fca7(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x25820
jmp 0x94a0b
jmp 0x94a0d
jmp 0x94a0f
jmp 0x94a11
movb $0x0, -0x1(%rbp)
movl $0x1, -0x9c(%rbp)
jmp 0x94a65
movq -0xa8(%rbp), %rdi
movq 0x70(%rdi), %rax
leaq 0x149d(%rip), %rcx      # 0x95ed0
movq %rcx, 0x10(%rax)
movq 0x70(%rdi), %rax
movq %rdi, 0x18(%rax)
movq -0x18(%rbp), %rsi
callq 0x95e60
movb %al, -0xf1(%rbp)
jmp 0x94a50
movb -0xf1(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movl $0x1, -0x9c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0xc3e0
leaq -0x40(%rbp), %rdi
callq 0x25c90
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
leaq -0x40(%rbp), %rdi
callq 0x25c90
movq -0x68(%rbp), %rdi
callq 0xcba0
nopw (%rax,%rax)