Hello! Amirouche <[email protected]> skribis:
> I am trying to connect to an imap server using SSL but it fails. The > program does > indeed connect to the remote server, but when I try to read on the > port it blocks > until the connection is closed by the remote host. [...] > (define (connect-to-server host port) > (let ((addrinfo (car (getaddrinfo host (number->string port))))) > (let ((port (socket (addrinfo:fam addrinfo) > SOCK_STREAM > IPPROTO_IP))) > ;; Disable Nagle's algorithm. We buffer ourselves. > (setsockopt port IPPROTO_TCP TCP_NODELAY 1) > (setvbuf port 'block 1024) > (connect port (addrinfo:addr addrinfo)) > port))) Did you try the exact same code on raw IMAP (without TLS)? It maybe that the bufferring you’re asking for above is waiting for more data than can be received at this point according to the IMAP protocol. HTH, Ludo’.
