亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? rpc.prog.ms

?? RTEMS (Real-Time Executive for Multiprocessor Systems) is a free open source real-time operating sys
?? MS
?? 第 1 頁 / 共 5 頁
字號:
		bool = TRUE;	else		bool = FALSE;	if (!svc_sendreply(transp, xdr_bool, &bool)) {		 fprintf(stderr, "can't reply to RPC call\en");		 return (1);	}	return;}.DE.KE.LPThe relevant routine is.I svc_getargs()which takes an.I SVCXPRThandle, the XDR routine,and a pointer to where the input is to be placed as arguments..NH 2\&Memory Allocation with XDR.IX "memory allocation with XDR".IX XDR "memory allocation".LPXDR routines not only do input and output,they also do memory allocation.This is why the second parameter of.I xdr_array()is a pointer to an array, rather than the array itself.If it is.I NULL ,then.I xdr_array()allocates space for the array and returns a pointer to it,putting the size of the array in the third argument.As an example, consider the following XDR routine.I xdr_chararr1()which deals with a fixed array of bytes with length.I SIZE ..ie t .DS.el .DS L.ft CWxdr_chararr1(xdrsp, chararr)	XDR *xdrsp;	char chararr[];{	char *p;	int len;	p = chararr;	len = SIZE;	return (xdr_bytes(xdrsp, &p, &len, SIZE));}.DEIf space has already been allocated in.I chararr ,it can be called from a server like this:.ie t .DS.el .DS L.ft CWchar chararr[SIZE];svc_getargs(transp, xdr_chararr1, chararr);.DEIf you want XDR to do the allocation,you would have to rewrite this routine in the following way:.ie t .DS.el .DS L.ft CWxdr_chararr2(xdrsp, chararrp)	XDR *xdrsp;	char **chararrp;{	int len;	len = SIZE;	return (xdr_bytes(xdrsp, charrarrp, &len, SIZE));}.DEThen the RPC call might look like this:.ie t .DS.el .DS L.ft CWchar *arrptr;arrptr = NULL;svc_getargs(transp, xdr_chararr2, &arrptr);.ft I/* * Use the result here */.ft CWsvc_freeargs(transp, xdr_chararr2, &arrptr);.DENote that, after being used, the character array can be freed with.I svc_freeargs().I svc_freeargs() will not attempt to free any memory if the variable indicating it is NULL.  For example, in the the routine .I xdr_finalexample (),given earlier, if.I finalp->string was NULL, then it would not be freed.  The same is true for .I finalp->simplep ..LPTo summarize, each XDR routine is responsiblefor serializing, deserializing, and freeing memory.When an XDR routine is called from.I callrpc()the serializing part is used.When called from.I svc_getargs()the deserializer is used.And when called from.I svc_freeargs()the memory deallocator is used.  When building simple examples like thosein this section, a user doesn't have to worry about the three modes.  See the.I "External Data Representation: Sun Technical Notes"for examples of more sophisticated XDR routines that determine which of the three modes they are in and adjust their behavior accordingly..KS.NH 2\&The Calling Side.IX RPC "calling side".LPWhen you use.I callrpc()you have no control over the RPC deliverymechanism or the socket used to transport the data.To illustrate the layer of RPC that lets you adjust theseparameters, consider the following code to call the.I nusersservice:.ie t .DS.el .DS L.ft CW.vs 11#include <stdio.h>#include <rpc/rpc.h>#include <utmp.h>#include <rpcsvc/rusers.h>#include <sys/socket.h>#include <sys/time.h>#include <netdb.h>main(argc, argv)	int argc;	char **argv;{	struct hostent *hp;	struct timeval pertry_timeout, total_timeout;	struct sockaddr_in server_addr;	int sock = RPC_ANYSOCK;	register CLIENT *client;	enum clnt_stat clnt_stat;	unsigned long nusers;	if (argc != 2) {		fprintf(stderr, "usage: nusers hostname\en");		exit(-1);	}	if ((hp = gethostbyname(argv[1])) == NULL) {		fprintf(stderr, "can't get addr for %s\en",argv[1]);		exit(-1);	}	pertry_timeout.tv_sec = 3;	pertry_timeout.tv_usec = 0;	bcopy(hp->h_addr, (caddr_t)&server_addr.sin_addr,		hp->h_length);	server_addr.sin_family = AF_INET;	server_addr.sin_port =  0;	if ((client = clntudp_create(&server_addr, RUSERSPROG,	  RUSERSVERS, pertry_timeout, &sock)) == NULL) {		clnt_pcreateerror("clntudp_create");		exit(-1);	}	total_timeout.tv_sec = 20;	total_timeout.tv_usec = 0;	clnt_stat = clnt_call(client, RUSERSPROC_NUM, xdr_void,		0, xdr_u_long, &nusers, total_timeout);	if (clnt_stat != RPC_SUCCESS) {		clnt_perror(client, "rpc");		exit(-1);	}	clnt_destroy(client);	close(sock);	exit(0);}.vs.DE.KEThe low-level version of.I callrpc()is.I clnt_call()which takes a.I CLIENTpointer rather than a host name.  The parameters to.I clnt_call() are a.I CLIENT pointer, the procedure number,the XDR routine for serializing the argument,a pointer to the argument,the XDR routine for deserializing the return value,a pointer to where the return value will be placed,and the time in seconds to wait for a reply..LPThe.I CLIENT pointer is encoded with the transport mechanism..I callrpc()uses UDP, thus it calls.I clntudp_create() to get a.I CLIENT pointer.  To get TCP (Transmission Control Protocol), you would use.I clnttcp_create() ..LPThe parameters to.I clntudp_create() are the server address, the program number, the version number,a timeout value (between tries), and a pointer to a socket.The final argument to.I clnt_call() is the total time to wait for a response.Thus, the number of tries is the.I clnt_call() timeout divided by the.I clntudp_create() timeout..LPNote that the.I clnt_destroy()callalways deallocates the space associated with the.I CLIENT handle.  It closes the socket associated with the.I CLIENT handle, however, only if the RPC library opened it.  It thesocket was opened by the user, it stays open.  This makes itpossible, in cases where there are multiple client handlesusing the same socket, to destroy one handle without closingthe socket that other handles are using..LPTo make a stream connection, the call to.I clntudp_create() is replaced with a call to.I clnttcp_create() ..DS.ft CWclnttcp_create(&server_addr, prognum, versnum, &sock,               inputsize, outputsize);.DEThere is no timeout argument; instead, the receive and send buffersizes must be specified.  When the.I clnttcp_create() call is made, a TCP connection is established.All RPC calls using that.I CLIENT handle would use this connection.The server side of an RPC call using TCP has.I svcudp_create()replaced by.I svctcp_create() ..DS.ft CWtransp = svctcp_create(RPC_ANYSOCK, 0, 0);.DEThe last two arguments to .I svctcp_create() are send and receive sizes respectively.  If `0' is specified for either of these, the system chooses a reasonable default..KS.NH 1\&Other RPC Features.IX "RPC" "miscellaneous features".IX "miscellaneous RPC features".LPThis section discusses some other aspects of RPCthat are occasionally useful..NH 2\&Select on the Server Side.IX RPC select() RPC \fIselect()\fP.IX select() "" \fIselect()\fP "on the server side".LPSuppose a process is processing RPC requestswhile performing some other activity.If the other activity involves periodically updating a data structure,the process can set an alarm signal before calling.I svc_run()But if the other activityinvolves waiting on a a file descriptor, the.I svc_run()call won't work.The code for.I svc_run()is as follows:.ie t .DS.el .DS L.ft CW.vs 11voidsvc_run(){	fd_set readfds;	int dtbsz = getdtablesize();	for (;;) {		readfds = svc_fds;		switch (select(dtbsz, &readfds, NULL,NULL,NULL)) {		case -1:			if (errno == EINTR)				continue;			perror("select");			return;		case 0:			break;		default:			svc_getreqset(&readfds);		}	}}.vs.DE.KE.LPYou can bypass.I svc_run()and call.I svc_getreqset()yourself.All you need to know are the file descriptorsof the socket(s) associated with the programs you are waiting on.Thus you can have your own.I select() .IX select() "" \fIselect()\fPthat waits on both the RPC socket,and your own descriptors.  Note that.I svc_fds() is a bit mask of all the file descriptors that RPC is using for services.  It can change everytime that.I anyRPC library routine is called, because descriptors are constantly being opened and closed, for example for TCP connections..NH 2\&Broadcast RPC.IX "broadcast RPC".IX RPC "broadcast".LPThe.I portmapperis a daemon that converts RPC program numbersinto DARPA protocol port numbers; see the.I portmap man page.  You can't do broadcast RPC without the portmapper.Here are the main differences betweenbroadcast RPC and normal RPC calls:.IP  1.Normal RPC expects one answer, whereasbroadcast RPC expects many answers(one or more answer from each responding machine)..IP  2.Broadcast RPC can only be supported by packet-oriented (connectionless)transport protocols like UPD/IP..IP  3.The implementation of broadcast RPCtreats all unsuccessful responses as garbage by filtering them out.Thus, if there is a version mismatch between thebroadcaster and a remote service,the user of broadcast RPC never knows..IP  4.All broadcast messages are sent to the portmap port.Thus, only services that register themselves with their portmapperare accessible via the broadcast RPC mechanism..IP  5.Broadcast requests are limited in size to the MTU (Maximum TransferUnit) of the local network.  For Ethernet, the MTU is 1500 bytes..KS.NH 3\&Broadcast RPC Synopsis.IX "broadcast RPC" synopsis.IX "RPC" "broadcast synopsis".ie t .DS.el .DS L.ft CW#include <rpc/pmap_clnt.h>	. . .enum clnt_stat	clnt_stat;	. . .clnt_stat = clnt_broadcast(prognum, versnum, procnum,  inproc, in, outproc, out, eachresult)	u_long    prognum;        /* \fIprogram number\fP */	u_long    versnum;        /* \fIversion number\fP */	u_long    procnum;        /* \fIprocedure number\fP */	xdrproc_t inproc;         /* \fIxdr routine for args\fP */	caddr_t   in;             /* \fIpointer to args\fP */	xdrproc_t outproc;        /* \fIxdr routine for results\fP */	caddr_t   out;            /* \fIpointer to results\fP */	bool_t    (*eachresult)();/* \fIcall with each result gotten\fP */.DE.KEThe procedure.I eachresult()is called each time a valid result is obtained.It returns a boolean that indicateswhether or not the user wants more responses..ie t .DS.el .DS L.ft CWbool_t done;	. . . done = eachresult(resultsp, raddr)	caddr_t resultsp;	struct sockaddr_in *raddr; /* \fIAddr of responding machine\fP */.DEIf.I doneis.I TRUE ,then broadcasting stops and.I clnt_broadcast()returns successfully.Otherwise, the routine waits for another response.The request is rebroadcastafter a few seconds of waiting.If no responses come back,the routine returns with.I RPC_TIMEDOUT ..NH 2\&Batching.IX "batching".IX RPC "batching".LPThe RPC architecture is designed so that clients send a call message,and wait for servers to reply that the call succeeded.This implies that clients do not computewhile servers are processing a call.This is inefficient if the client does not want or needan acknowledgement for every message sent.It is possible for clients to continue computingwhile waiting for a response,using RPC batch facilities..LPRPC messages can be placed in a \*Qpipeline\*U of callsto a desired server; this is called batching.Batching assumes that:1) each RPC call in the pipeline requires no response from the server,and the server does not send a response message; and2) the pipeline of calls is transported on a reliablebyte stream transport such as TCP/IP.Since the server does not respond to every call,the client can generate new calls in parallelwith the server executing previous calls.Furthermore, the TCP/IP implementation can buffer upmany call messages, and send them to the server in one.I write()system call.  This overlapped executiongreatly decreases the interprocess communication overhead ofthe client and server processes,and the total elapsed time of a series of calls..LPSince the batched calls are buffered,the client should eventually do a nonbatched callin order to flush the pipeline..LPA contrived example of batching follows.Assume a string rendering service (like a window system)has two similar calls: one renders a string and returns void results,while the other renders a string and remains silent.The service (using the TCP/IP transport) may look like:.ie t .DS.el .DS L.ft CW#include <stdio.h>#include <rpc/rpc.h>#include <suntool/windows.h>void windowdispatch();main(){	SVCXPRT *transp;	transp = svctcp_create(RPC_ANYSOCK, 0, 0);	if (transp == NULL){		fprintf(stderr, "can't create an RPC server\en");		exit(1);	}	pmap_unset(WINDOWPROG, WINDOWVERS);	if (!svc_register(transp, WINDOWPROG, WINDOWVERS,	  windowdispatch, IPPROTO_TCP)) {		fprintf(stderr, "can't register WINDOW service\en");		exit(1);	}	svc_run();  /* \fINever returns\fP */	fprintf(stderr, "should never reach this point\en");}voidwindowdispatch(rqstp, transp)	struct svc_req *rqstp;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久国产精品人| 国产精品不卡在线观看| 欧美激情一区二区三区不卡| 亚洲欧美日韩国产手机在线| 久久91精品国产91久久小草| 97久久精品人人澡人人爽| 欧美一区三区二区| 亚洲激情自拍偷拍| 国产成人精品亚洲777人妖| 欧美日韩免费观看一区二区三区 | 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 日韩欧美国产wwwww| 亚洲日本乱码在线观看| 国产一区在线精品| 欧美久久久久久蜜桃| 亚洲欧美日韩人成在线播放| 成人中文字幕在线| 精品不卡在线视频| 免费成人在线视频观看| 欧美日韩精品欧美日韩精品| 亚洲日本中文字幕区| 成人午夜激情影院| 久久九九久久九九| 欧美性大战久久久久久久蜜臀| 国产一区二区美女诱惑| 欧美性感一类影片在线播放| 国产精品理论片在线观看| 国产一区二区三区免费看| 精品久久久久久久久久久久包黑料 | 91免费在线看| 国产精品久久网站| 丁香激情综合国产| 国产精品久久久久久久久快鸭 | 亚洲成人资源在线| 欧美性生活影院| 亚洲免费av观看| 色欧美乱欧美15图片| 亚洲女人****多毛耸耸8| 99久久精品国产观看| 中文字幕一区二区三区在线播放| 国产成a人亚洲精| 国产女同性恋一区二区| 成人性视频网站| 中文字幕一区二区5566日韩| av在线播放一区二区三区| 综合久久国产九一剧情麻豆| 97se亚洲国产综合自在线观| 亚洲激情图片qvod| 在线视频国内一区二区| 午夜激情一区二区三区| 日韩视频一区在线观看| 久草在线在线精品观看| 国产欧美一区二区三区在线看蜜臀 | 在线观看欧美精品| 日韩二区三区四区| 久久午夜免费电影| 99re这里都是精品| 香蕉久久夜色精品国产使用方法| 日韩欧美国产一二三区| 成人爽a毛片一区二区免费| ...xxx性欧美| 88在线观看91蜜桃国自产| 久草中文综合在线| 亚洲乱码日产精品bd| 911精品国产一区二区在线| 精品一区二区三区的国产在线播放| 国产亚洲女人久久久久毛片| 在线免费观看视频一区| 精品一区二区影视| 亚洲欧美电影一区二区| 91精品国产一区二区| 国产+成+人+亚洲欧洲自线| 亚洲香肠在线观看| 久久久高清一区二区三区| 91福利在线播放| 韩日精品视频一区| 亚洲午夜激情av| 国产欧美日韩不卡免费| 欧美美女直播网站| av在线播放不卡| 久久激情综合网| 亚洲一区视频在线| 中文在线资源观看网站视频免费不卡| 欧美三级中文字幕| 99久久99久久综合| 国产毛片精品一区| 日韩一区欧美二区| 一区二区三区久久| 欧美国产精品劲爆| 精品免费一区二区三区| 欧美日韩一区二区三区在线 | 自拍av一区二区三区| 欧美大片在线观看一区| 欧美色倩网站大全免费| 99久精品国产| 国产 欧美在线| 国产在线日韩欧美| 免费欧美在线视频| 香蕉影视欧美成人| 亚洲一区二区三区四区在线 | 91久久精品日日躁夜夜躁欧美| 国产专区综合网| 全国精品久久少妇| 亚洲成人自拍一区| 亚洲不卡在线观看| 亚洲国产另类av| 亚洲国产日日夜夜| 一区二区三区欧美视频| 国产精品美女久久久久久久久 | 亚洲午夜电影网| 伊人开心综合网| 亚洲欧美日韩在线播放| 一区二区中文视频| 中文字幕一区在线观看视频| 国产精品美女www爽爽爽| 国产女同性恋一区二区| 欧美国产精品一区二区| 国产精品乱码一区二区三区软件| 久久综合久久综合久久| 久久影视一区二区| 久久久www成人免费无遮挡大片| 精品区一区二区| 国产三级精品在线| 国产精品免费视频网站| 中文字幕一区免费在线观看| 中文欧美字幕免费| 亚洲男人的天堂在线aⅴ视频| 亚洲欧美另类综合偷拍| 亚洲无人区一区| 蜜臀av性久久久久蜜臀av麻豆 | 久久众筹精品私拍模特| 久久久美女艺术照精彩视频福利播放| 久久久精品影视| 亚洲图片激情小说| 亚洲国产cao| 蜜臀久久99精品久久久久久9| 久久91精品久久久久久秒播| 成人动漫一区二区| 欧美无砖专区一中文字| 日韩精品中文字幕在线不卡尤物| 久久麻豆一区二区| 亚洲人成精品久久久久久| 五月天丁香久久| 国内精品写真在线观看| 色呦呦国产精品| 欧美一区二区性放荡片| 国产喂奶挤奶一区二区三区| 亚洲男女一区二区三区| 日韩影视精彩在线| 成人黄色电影在线| 在线播放视频一区| 国产精品美女久久久久高潮| 亚洲国产一区二区在线播放| 国产美女视频一区| 欧美男女性生活在线直播观看| 久久久久国产成人精品亚洲午夜| 一区二区高清免费观看影视大全| 蜜桃av一区二区三区电影| 99麻豆久久久国产精品免费| 制服丝袜亚洲色图| 亚洲桃色在线一区| 激情五月婷婷综合| 精品视频资源站| 欧美激情一区不卡| 免费av网站大全久久| 色婷婷精品久久二区二区蜜臂av| 欧美成人一区二区| 亚洲综合丁香婷婷六月香| 国产精品主播直播| 日韩视频不卡中文| 亚洲综合免费观看高清完整版在线| 国产精品中文欧美| 欧美一区二区三区免费大片| 亚洲同性gay激情无套| 国产成人丝袜美腿| 日韩一区二区在线观看| 亚洲黄色免费电影| 99久久久免费精品国产一区二区| 久久亚洲综合色| 青青草国产精品亚洲专区无| 在线观看免费成人| 樱桃视频在线观看一区| 风间由美一区二区三区在线观看| 日韩欧美综合一区| 亚洲成人精品影院| 欧洲一区二区三区在线| 亚洲婷婷在线视频| 成人在线综合网站| 国产亚洲va综合人人澡精品| 美国毛片一区二区| 91精品国产91热久久久做人人| 亚洲成人一区二区在线观看| 色婷婷av一区二区三区gif| 中文字幕一区二区三区在线不卡| 国产传媒一区在线| 久久精品欧美一区二区三区麻豆 | 日日摸夜夜添夜夜添精品视频| 色成年激情久久综合| 日韩伦理免费电影| 欧美亚洲动漫制服丝袜|