Hello,

When you try to establish DTLS connection you should use timeouts as said in
RFC. DTLS uses socket's timeouts. Windows sockets have some differences in
"timeout API", but DTLS does not consider them. So when you set timeouts
with BIO_ctrl() and BIO_CTRL_DGRAM_SET_RECV_TIMEOUT or
BIO_CTRL_DGRAM_SET_SEND_TIMEOUT it does not work properly.

Differences in "timeout API":

1. If recv(...) or send(...) fails due to timeout WSAGetLastError() returns
WSAETIMEDOUT, but not EAGAIN. But DTLS checks for EAGAIN. So, for DTLS
timeout does not happen. See dgram_ctrl(...) function in bss_dgram.c file
for commands BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP and
BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP.

2. setsockopt(...) function with SO_RCVTIMEO and SO_SNDTIMEO commands
requires "unsigned long" type as time value. And time should be in
milliseconds. May be on Win platforms DTLS should use "sizeof(unsigned
long)" as last parameter to setsockopt(...) in dgram_ctrl(...) function in
bss_dgram.c file for BIO_CTRL_DGRAM_SET_*_TIMEOUT commands.

OpenSSL version:
OpenSSL 0.9.8g 19 Oct 2007
built on: Tue Dec 11 08:25:22 2007
platform: VC-WIN32
options: bn(64,32) md2(int) rc4(idx,int) des(idx,cisc,4,long) idea(int)
blowfish(idx)
compiler: cl /MD /Ox /O2 /Ob2 /W3 /WX /Gs0 /GF /Gy
/nologo -DOPENSSL_SYSNAME_WI
N32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -D_CRT_SECURE_NO_DEPRECATE
-D_C
RT_NONSTDC_NO_DEPRECATE -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DAES_ASM -DBN_A
SM -DOPENSSL_BN_ASM_PART_WORDS -DMD5_ASM -DSHA1_ASM -DRMD160_ASM -DOPENSSL_USE_A
PPLINK -I.
/Fdout32dll -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_SEED -DOPENSSL_NO_RC5
-DOPENSSL_NO_MDC2 -DOPENSSL_NO_TLSEXT -DOPENSSL_NO_KRB5 -DOPENSSL_NO_DYNAMIC_ENG
INE
OPENSSLDIR: "c:/some/openssl/dir/ssl"

OS: Windows XP SP2 32bit
Compiler: Visual C++ 2005 Express Edition
Hardware: AMD Athlon 64 X2

Pavel

__________________________________________________ ____________________
OpenSSL Project http://www.openssl.org
Development Mailing List openssl-dev@openssl.org
Automated List Manager majordomo@openssl.org