simpserv.c

来自「电力与银行通讯的源码 1.应用tuxedo中间件. 2.与银行的前置机通讯.」· C语言 代码 · 共 66 行

C
66
字号
/*	Copyright (c) 1997 BEA Systems, Inc.  	All rights reserved  	THIS IS UNPUBLISHED PROPRIETARY  	SOURCE CODE OF BEA Systems, Inc.  	The copyright notice above does not  	evidence any actual or intended  	publication of such source code.*//* #ident	"@(#) apps/simpapp/simpserv.c	$Revision: 1.3 $" */#include <stdio.h>#include <ctype.h>#include <atmi.h>	/* TUXEDO Header File */#include <userlog.h>	/* TUXEDO Header File *//* tpsvrinit is executed when a server is booted, before it begins   processing requests.  It is not necessary to have this function.   Also available is tpsvrdone (not used in this example), which is   called at server shutdown time.*/#if defined(__STDC__) || defined(__cplusplus)tpsvrinit(int argc, char *argv[])#elsetpsvrinit(argc, argv)int argc;char **argv;#endif{	/* Some compilers warn if argc and argv aren't used. */	argc = argc;	argv = argv;	/* userlog writes to the central TUXEDO message log */	userlog("Welcome to the simple server");	return(0);}/* This function performs the actual service requested by the client.   Its argument is a structure containing among other things a pointer   to the data buffer, and the length of the data buffer.*/#ifdef __cplusplusextern "C"#endifvoid#if defined(__STDC__) || defined(__cplusplus)TOUPPER(TPSVCINFO *rqst)#elseTOUPPER(rqst)TPSVCINFO *rqst;#endif{	int i;	for(i = 0; i < rqst->len-1; i++)		rqst->data[i] = toupper(rqst->data[i]);	/* Return the transformed buffer to the requestor. */	tpreturn(TPSUCCESS, 0, rqst->data, 0L, 0);}

⌨️ 快捷键说明

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