// File: maydali28[P]cpp-socket/prog.cpp
// Function: main
int main(void){
  matrix_hal::server *srv = new matrix_hal::server(8080);
  int err = srv->bind();
  if(err != 0){
    std::cout<<strerror(err)<<std::endl;
    exit(err);
  }
  matrix_hal::socketUDP* socket = srv->getConnexion();
  if(!socket->valid()){
    delete socket;
    exit(0);
  }

std::valarray<int16_t> raw_data_ = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
// matrix_hal::Datagram msg;
//    while (true) {
int tab[1024];
for(int i = 0;i<1024;i++){
tab[i] = 11111;
printf("%d\n",tab[i] );
}
  		socket->send("127.0.0.1",2012,raw_data_,raw_data_.size()) == 1 ? std::cout<<"ok"<<std::endl : std::cout<<"not ok"<<std::endl;
  		// std::cout<<msg.data<<std::endl;
//  }


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10e0, %rsp           # imm = 0x10E0
movl $0x0, -0x4(%rbp)
movl $0x38, %edi
callq 0x21b0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x10a8(%rbp)
movl $0x1f90, %esi           # imm = 0x1F90
callq 0x2480
jmp 0x3695
movq -0x10a8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x25b0
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
je 0x36fd
movl -0x20(%rbp), %edi
callq 0x20c0
movq %rax, %rsi
movq 0x2914(%rip), %rdi      # 0x5fd8
callq 0x21a0
movq %rax, %rdi
movq 0x28f5(%rip), %rsi      # 0x5fc8
callq 0x21d0
movl -0x20(%rbp), %edi
callq 0x2200
movq -0x10a8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x2190
jmp 0x397f
movq -0x10(%rbp), %rdi
callq 0x2770
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x2ad0
testb $0x1, %al
jne 0x3747
movq -0x28(%rbp), %rax
movq %rax, -0x10b0(%rbp)
cmpq $0x0, %rax
je 0x3740
movq -0x10b0(%rbp), %rdi
callq 0x2a50
movq -0x10b0(%rbp), %rdi
callq 0x2190
xorl %edi, %edi
callq 0x2200
movq 0x8c8(%rip), %rax       # 0x4016
movq %rax, -0x5c(%rbp)
movq 0x8c5(%rip), %rax       # 0x401e
movq %rax, -0x54(%rbp)
movl 0x8c3(%rip), %eax       # 0x4026
movl %eax, -0x4c(%rbp)
leaq -0x5c(%rbp), %rax
movq %rax, -0x48(%rbp)
movq $0xa, -0x40(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x3990
movl $0x0, -0x1064(%rbp)
cmpl $0x400, -0x1064(%rbp)   # imm = 0x400
jge 0x37f1
movslq -0x1064(%rbp), %rax
movl $0x2b67, -0x1060(%rbp,%rax,4) # imm = 0x2B67
movslq -0x1064(%rbp), %rax
movl -0x1060(%rbp,%rax,4), %esi
leaq 0x84b(%rip), %rdi       # 0x400f
xorl %eax, %eax
callq 0x2050
jmp 0x37cd
jmp 0x37cf
movl -0x1064(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1064(%rbp)
jmp 0x3791
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x3976
movq -0x28(%rbp), %rax
movq %rax, -0x10c0(%rbp)
leaq -0x1089(%rbp), %rdi
movq %rdi, -0x10b8(%rbp)
callq 0x2290
movq -0x10b8(%rbp), %rdx
leaq 0x80d(%rip), %rsi       # 0x402a
leaq -0x1088(%rbp), %rdi
callq 0x2240
jmp 0x382b
leaq -0x10a0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x3a10
jmp 0x383d
leaq -0x38(%rbp), %rdi
callq 0x3160
movq %rax, -0x10c8(%rbp)
jmp 0x384f
movq -0x10c0(%rbp), %rdi
movq -0x10c8(%rbp), %rax
movl %eax, %r8d
leaq -0x1088(%rbp), %rsi
movl $0x7dc, %edx            # imm = 0x7DC
leaq -0x10a0(%rbp), %rcx
callq 0x2e10
movl %eax, -0x10cc(%rbp)
jmp 0x3880
movl -0x10cc(%rbp), %eax
cmpl $0x1, %eax
jne 0x38be
movq 0x2746(%rip), %rdi      # 0x5fd8
leaq 0x79f(%rip), %rsi       # 0x4038
callq 0x21a0
movq %rax, -0x10d8(%rbp)
jmp 0x38a7
movq -0x10d8(%rbp), %rdi
movq 0x2713(%rip), %rsi      # 0x5fc8
callq 0x21d0
jmp 0x38bc
jmp 0x38f1
movq 0x2713(%rip), %rdi      # 0x5fd8
leaq 0x768(%rip), %rsi       # 0x4034
callq 0x21a0
movq %rax, -0x10e0(%rbp)
jmp 0x38da
movq -0x10e0(%rbp), %rdi
movq 0x26e0(%rip), %rsi      # 0x5fc8
callq 0x21d0
jmp 0x38ef
jmp 0x38f1
leaq -0x10a0(%rbp), %rdi
callq 0x3a80
leaq -0x1088(%rbp), %rdi
callq 0x2110
leaq -0x1089(%rbp), %rdi
callq 0x21e0
leaq -0x38(%rbp), %rdi
callq 0x3a80
movl -0x4(%rbp), %eax
addq $0x10e0, %rsp           # imm = 0x10E0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x396a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x395e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x10a0(%rbp), %rdi
callq 0x3a80
leaq -0x1088(%rbp), %rdi
callq 0x2110
leaq -0x1089(%rbp), %rdi
callq 0x21e0
leaq -0x38(%rbp), %rdi
callq 0x3a80
movq -0x18(%rbp), %rdi
callq 0x2280
nopl (%rax,%rax)