From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Tue, 17 May 2005 18:04:20 +0200 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() Message-Id: <20050517180420.77bf702d.20h@r-36.net> In-Reply-To: References: <10520507828.20050517155314@mail.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 4cf66588-ead0-11e9-9d60-3106f5b1d025 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 wrote: > > > On Tue, 17 May 2005, Russ Cox wrote: > > > What does your program look like? > > Here is the client code.. > -ishwar > ----- > #include > #include > > 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); > } > ---