unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: guile-user@gnu.org
Cc: gnutls-help@lists.gnutls.org
Subject: Re: IMAP SSL Connection using Guile
Date: Tue, 02 May 2017 13:58:28 +0200	[thread overview]
Message-ID: <874lx3jwrf.fsf@gnu.org> (raw)
In-Reply-To: 88f9dfe0-2649-253e-97ee-eb5210e53dc9@hypermove.net

Hello!

Amirouche <amirouche@hypermove.net> 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’.




  reply	other threads:[~2017-05-02 11:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-30 16:42 IMAP SSL Connection using Guile Amirouche
2017-05-02 11:58 ` Ludovic Courtès [this message]
2017-05-02 19:47 ` Andy Wingo
2017-05-03 19:07   ` Amirouche Boubekki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874lx3jwrf.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=gnutls-help@lists.gnutls.org \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).