> Hi Sebastian, > > On Jan 17, 2011, at 4:12 PM, Sebastian Proca wrote: > > > It's strange for me how comes that, depending on the > specified arguments, I get two different errors: > > > > I case : > > > > # ./dtls_udp_echo 127.0.0.1 > > SSL_connect: Connection refused > > error:00000000:lib(0):func(0):reason(0) > > Unexpected error while writing: 5 > > error:00000000:lib(0):func(0):reason(0) > > > > II case : > > > > # ./dtls_udp_echo -p 23232 -V 127.0.0.1 > > SSL_connect: Connection refused > > error:00000000:lib(0):func(0):reason(0) > > > > Connected to 127.0.0.1 > > > ------------------------------------------------------------ > > Segmentation fault > > > > Wireshark shows the beginning of dtls negotiation, but > it's clear that after these errors, it stops. > > > > Does someone know the correct usage of this sample? > I'm out of ideas! > > You probably don't have a server running. Use: > > ./dtls_udp_echo > > without any parameters to start a server listening on all > available addresses. You can then start a client with: > > ./dtls_udp_echo 127.0.0.1 > > All of the examples listed on our website are both server > and client. If you specify an address on the command line, > it will use it to start a client which connects to it. > Otherwise, without an address it will start a server and > listen for incoming connections. > > Best regards > Robin
Hi Robin, Thank you for your help! I understand now the way that this application should be used. Yet, I didn't manage to obtain a working dtls session. After I start the server : # ./dtls_udp_echo I start the client, but I receive the error bellow: # ./dtls_udp_echo 127.0.0.1 Unexpected error while writing: 1 error:14103138:SSL routines:DTLS1_READ_FAILED:read timeout expired, but the started server shows no error, nothing. I wanted to understand more of these errors so I used strace. At the server's part I saw few lines that caught my attention: ================================================================== # ./dtls_udp_echo execve("./dtls_udp_echo", ["./dtls_udp_echo"], [/* 39 vars */]) = 0 brk(0) = 0x8d6b000 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77a6000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=83867, ...}) = 0 mmap2(NULL, 83867, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7791000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) ... more lines ... mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb778f000 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb778e000 set_thread_area({entry_number:-1 -> 6, base_addr:0xb778e6c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0 mprotect(0xe2c000, 4096, PROT_READ) = 0 mprotect(0x268000, 8192, PROT_READ) = 0 mprotect(0xd58000, 4096, PROT_READ) = 0 mprotect(0x112000, 4096, PROT_READ) = 0 mprotect(0x573000, 32768, PROT_READ) = 0 mprotect(0xf6a000, 4096, PROT_READ) = 0 mprotect(0x804c000, 4096, PROT_READ) = 0 mprotect(0x3c9000, 4096, PROT_READ) = 0 munmap(0xb7791000, 83867) = 0 set_tid_address(0xb778e728) = 12589 set_robust_list(0xb778e730, 0xc) = 0 futex(0xbfb1c2a0, FUTEX_WAKE_PRIVATE, 1) = 0 futex(0xbfb1c2a0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, bfb1c2b0) = -1 EAGAIN (Resource temporarily unavailable) .... ====================================================== On client's side I get these traces: write(3, "\26\376\377\0\0\0\0\0\0\0\0\0?\1\0\0003\0\0\0\0\0\0\0003\376\377M6\276\316\3"..., 76) = 76 recvfrom(3, 0x9f5b3c0, 18437, 0, 0xbfc40ebc, 0xbfc40eb8) = -1 EAGAIN (Resource temporarily unavailable) getsockopt(3, SOL_IP, 0xe /* IP_??? */, [16436], [4]) = 0 ====================================================== So the message that both server and client have is "Resource temporarily unavailable". Did someone have the same problem? How can this be solved? Regards, Sebastian