unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Alex Sassmannshausen <alex.sassmannshausen@gmail.com>
To: "Aleix Conchillo Flaqué" <aconchillo@gmail.com>
Cc: guile-user <guile-user@gnu.org>
Subject: Re: Unix Domain Sockets and (write) (read)
Date: Fri, 05 Jul 2013 00:05:43 +0200	[thread overview]
Message-ID: <87txkaugjs.fsf@honeybear.home> (raw)
In-Reply-To: <CA+XASoWDt-JLhxXNhL4zo4p-6bNF9gNC8o0Oo4C-xa51LFhovQ@mail.gmail.com> ("Aleix Conchillo \=\?utf-8\?Q\?Flaqu\=C3\=A9\=22's\?\= message of "Tue, 2 Jul 2013 15:57:08 -0700")


Hello again,

Aleix Conchillo Flaqué <aconchillo@gmail.com> writes:

> 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.

Ah, so that is the missing piece in the puzzle. Thanks for your
response.

>
> 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.

In the meantime I've also figured out that read-line and write-line
allows me to have this 2-way conversation…

I'm thinking of writing a summary of my attempts as a novice in socket
communications with an example of Unix domain sockets in action. Do
people think that something like that might also be a useful addition to
the network chapter in Guile's manual? Or is the Examples section kept
quite brief on purpose?

Best wishes,

Alex



  reply	other threads:[~2013-07-04 22:05 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é
2013-07-04 22:05   ` Alex Sassmannshausen [this message]
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=87txkaugjs.fsf@honeybear.home \
    --to=alex.sassmannshausen@gmail.com \
    --cc=aconchillo@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).