File:  [XINU] / xinu / sys / rfsend.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:39:04 2018 UTC (8 years, 2 months ago) by root
Branches: xinu, MAIN
CVS tags: xinu-19870308, HEAD
Xinu for VAX

/* rfsend.c - rfsend */

#include <conf.h>
#include <kernel.h>
#include <network.h>

/*------------------------------------------------------------------------
 *  rfsend  --  send message to remote server and await reply
 *------------------------------------------------------------------------
 */
rfsend(fptr, reqlen, rplylen)
struct	fphdr	*fptr;
int	reqlen;
int	rplylen;
{
	int	trys;
	int	ret;
	PStype	ps;

	/* Clear server queue, and send packet to it */

	if (Rf.device == RCLOSED) {
		Rf.device = open(INTERNET, RSERVER, ANYLPORT);
		if (Rf.device == SYSERR ||
		    control(Rf.device, DG_SETMODE, DG_DMODE|DG_TMODE)
		    == SYSERR)
			return(SYSERR);
	}
	disable(ps);
	control(Rf.device, DG_CLEAR);
	for (trys=0 ; trys<RMAXTRY ; trys++) {
		if ( write(Rf.device, fptr, reqlen)
			== SYSERR) {
			restore(ps);
			return(SYSERR);
		}
		if ( (ret=read(Rf.device, fptr, rplylen) )
		    !=SYSERR && ret != TIMEOUT) {
			restore(ps);
			return(ret);
		}
	}
	restore(ps);
	return(SYSERR);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.