A From:	SMTP%"RELAY-INFO-VAX@CRVAX.SRI.COM"  5-MAY-1993 16:56:51.66  To:	EVERHART CC:	6 Subj:	Re: Need help with Multinet & TCP/IP Programming  Y X-Newsgroups: comp.lang.c,comp.os.vms,comp.dcom.lans.misc,vmsnet.networks.tcp-ip.multinet ' From: adelman@tgv.com (Kenneth Adelman) 9 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.gov5 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   t In article <1s6i35$c8c@zip.eecs.umich.edu>, macika@emunix.emich.edu (Dominic Macika (Ass. Lab Supervisor)) writes...A >Howdy.  We recently had Multinet installed on our Vax 4000's and B >I'm exploring some tcp/ip programming.  I've hit a snag and can'tB >seem to find any answer for it.  I'm simply trying to send a dataA >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 andF >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.  >  > 2 >  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 */ > 4 >  n = recvfrom(s, buf, sizeof(buf), 0, &sin, &len); >  if (n < 0) {  >    barf("recvform\n"); >  }2 >  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   