⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 client.c

📁 让你了解Unix进程间的通信是如何实现的
💻 C
字号:
#include	"unpipc.h"		/* our header */#include	"square.h"		/* generated by rpcgen */intmain(int argc, char **argv){	CLIENT		*cl;	square_in	in;	square_out	*outp;	if (argc != 3)		err_quit("usage: client <hostname> <integer-value>");	cl = Clnt_create(argv[1], SQUARE_PROG, SQUARE_VERS, "tcp");	in.arg1 = atol(argv[2]);	if ( (outp = squareproc_1(&in, cl)) == NULL)		err_quit("%s", clnt_sperror(cl, argv[1]));	printf("result: %ld\n", outp->res1);	in.arg1 *= 2;	if ( (outp = squareproc_1(&in, cl)) == NULL)		err_quit("%s", clnt_sperror(cl, argv[1]));	printf("result: %ld\n", outp->res1);	clnt_destroy(cl);	pause();	exit(0);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -