From: SMTP%"RELAY-INFO-VAX@CRVAX.SRI.COM" 5-MAY-1993 16:56:51.66 To: EVERHART CC: Subj: Re: Need help with Multinet & TCP/IP Programming X-Newsgroups: comp.lang.c,comp.os.vms,comp.dcom.lans.misc,vmsnet.networks.tcp-ip.multinet From: adelman@tgv.com (Kenneth Adelman) Subject: Re: Need help with Multinet & TCP/IP Programming Message-Id: <4MAY199320203295@tgv.com> Summary: help with tcp/ip News-Software: VAX/VMS VNEWS 1.41 Keywords: tcp/ip, recvfrom() Sender: usenet@news.arc.nasa.gov Organization: TGV, Incorporated (Santa Cruz, CA, USA) Date: Wed, 5 May 1993 03:20:00 GMT Lines: 42 To: Info-VAX@kl.sri.com X-Gateway-Source-Info: USENET In article <1s6i35$c8c@zip.eecs.umich.edu>, macika@emunix.emich.edu (Dominic Macika (Ass. Lab Supervisor)) writes... >Howdy. We recently had Multinet installed on our Vax 4000's and >I'm exploring some tcp/ip programming. I've hit a snag and can't >seem to find any answer for it. I'm simply trying to send a data >gram from our unix system to our vax system. The server program >I've written for the vax end hangs at the recvfrom() function. >I assume it's not receiving the data I'm sending it. Any and >all comments, suggestions and answers (heck, I'll even accept flames >at this point, as long as they lead to something useful) will >be greatly appreciated. Please resond via email and I will >post a summary, etc. > > > if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { > barf("error opening socket\n"); > } > > barf("socket open\n"); > > len = sizeof(sin); > barf("going into recvfrom\n"); > >/* this is the last message that makes it to my errorlog */ > > n = recvfrom(s, buf, sizeof(buf), 0, &sin, &len); > if (n < 0) { > barf("recvform\n"); > } > barf("Data received, heading for the file.\n"); You need to do a bind() operation on the socket to tell the network what port you want to accept packets on. Something like: bzero((char *) &sin, sizeof(sin)); sin.sin_family = AF_INET; sin.sin_port = htons(PORT); n = bind(s, &sin, sizeof(sin)); if (n < 0) { barf("bind"); } Ken