9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Christoph Lohmann <20h@r-36.net>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] Question on dial()
Date: Tue, 17 May 2005 18:04:20 +0200	[thread overview]
Message-ID: <20050517180420.77bf702d.20h@r-36.net> (raw)
In-Reply-To: <Pine.GSO.4.58.0505171017230.8487@cps3.cps.cmich.edu>

Good day.

Can you resolve the hostname "tigaon" on the same machine? For an echo
server; look at dial(2), which shows one in the EXAMPLES section.

Sincerely,

Christoph

On Tue, 17 May 2005 10:19:59 -0400 (EDT)
I RATTAN <rattan@cps.cmich.edu> wrote:

> 
> 
> On Tue, 17 May 2005, Russ Cox wrote:
> 
> > What does your program look like?
> 
> Here is the client code..
> -ishwar
> -----
> #include <u.h>
> #include <libc.h>
> 
> void
> main(void)
> {
>    char ibuf[128], obuf[33]="98765432109876543210987654321098";
> 
>    int fd, i, len;
> 
> 
>    if((fd = dial("tcp!tigaon!7", 0, 0, 0)) < 0)
>         sysfatal("dial");
>    for (i = 0; i < 21; i++) {
>         obuf[33-i] = 0;
>         len = strlen(obuf) + 1;
>         if(write(fd, obuf, len) != len)
>                 sysfatal("write");
>         if(read(fd, ibuf, 128) > 0)
>                 print("Got from server: %s\n", ibuf);
>     }
>     close(fd);
>     exits(nil);
> }
> ---


  parent reply	other threads:[~2005-05-17 16:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-17 12:53 [9fans] thread, utf Sergey Reva
2005-05-17 13:28 ` [9fans] Question on dial() I RATTAN
2005-05-17 14:04   ` Russ Cox
2005-05-17 14:19     ` I RATTAN
2005-05-17 15:35       ` Robert Raschke
2005-05-17 16:04       ` Christoph Lohmann [this message]
2005-05-17 16:17       ` "Nils O. Selåsdal"
2005-05-17 14:04 ` [9fans] thread, utf Russ Cox

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

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

  git send-email \
    --in-reply-to=20050517180420.77bf702d.20h@r-36.net \
    --to=20h@r-36.net \
    --cc=9fans@cse.psu.edu \
    /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 NNTP newsgroup(s).