From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu From: andrey mirtchovski MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20020415145704.7C64A19981@mail.cse.psu.edu> Subject: [9fans] rudp Date: Mon, 15 Apr 2002 08:58:23 -0600 Topicbox-Message-UUID: 77aa55e2-eaca-11e9-9e20-41e7f4b1d025 Hi, I'm trying to use rudp for testing purpouses around here, but I'm a tad puzzled by the semantics. All I want to do is fork once and have one process connect and send a string (or many) to another using the rudp protocol. Ip(3) says that listen is not an option, so the only thing I do is announce() on one side and connect() on the other. Unfortunately it doesn't seem to connect at all. I looked at /sys/src/cmd/ndb/dnudpserver.c but I think there should be a simpler way of doing things... Error reported on connect is: can't connect: file does not exist(/net/MACHINE/clone) where MACHINE is the host i'm connecting to (localhost)... What am I doing wrong and where should I look for more documentation? Thanx, Andrey Oh, yes, obligatory code paste: this is how I'm trying to connect. char *proto = "rudp"; char *port = "5557"; char *host = "ps1"; char adir[40]; char str[40] = "this is a test\n"; char data[8192]; void main() { int fd, fd2; switch (fork()) { case 0: sleep(5000); if((fd = dial(netmkaddr(proto, host, port), 0, 0, 0)) < 0) { perror("can't connect"); exits("connect"); } write(fd, str, strlen(str)); exits(0); default: if((fd2 = announce(netmkaddr("*", proto, port), adir)) < 0) { perror("can't announce"); exits("announce"); } while(read(fd2, data, 8192) > 0) print("parent: %s\n", data); exits(0); } }