unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: "Aleix Conchillo Flaqué" <aconchillo@gmail.com>
To: Alex Sassmannshausen <alex.sassmannshausen@gmail.com>
Cc: guile-user <guile-user@gnu.org>
Subject: Re: Unix Domain Sockets and (write) (read)
Date: Tue, 2 Jul 2013 15:57:08 -0700	[thread overview]
Message-ID: <CA+XASoWDt-JLhxXNhL4zo4p-6bNF9gNC8o0Oo4C-xa51LFhovQ@mail.gmail.com> (raw)
In-Reply-To: <87y59o61c4.fsf@honeybear.home>

On Tue, Jul 2, 2013 at 3:31 PM, Alex Sassmannshausen
<alex.sassmannshausen@gmail.com> wrote:
>
> My question is simply: is this supposed to happen? Would I somehow need
> to close and re-open the socket to have a two-way conversation between
> the client and the server (e.g. client writes request, closes the socket,
> server reads from socket, evaluates, client re-connects, server provides
> response)?
>

I think that the answer is yes. It is supposed to happen with the code
you provided.

When the server calls (write) you should flush the port (force-output)
so data gets immediately sent to the client, if that's what you want.

For the two-way conversation, you simply need to keep on calling
(read) and (write) wherever you want in the server and/or client and
not close the socket until you are really done.

Aleix



  reply	other threads:[~2013-07-02 22:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-02 22:31 Unix Domain Sockets and (write) (read) Alex Sassmannshausen
2013-07-02 22:57 ` Aleix Conchillo Flaqué [this message]
2013-07-04 22:05   ` Alex Sassmannshausen
2013-07-05 12:25     ` Ludovic Courtès
2013-07-16 17:17       ` Alex Sassmannshausen

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=CA+XASoWDt-JLhxXNhL4zo4p-6bNF9gNC8o0Oo4C-xa51LFhovQ@mail.gmail.com \
    --to=aconchillo@gmail.com \
    --cc=alex.sassmannshausen@gmail.com \
    --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).