我做了一个simpapp的例子,只是客户端服务器端不为同一台机子在服务端的tuxeconfig的服务中配置
WSL SRVGRP=GROUP1 SRVID=500 RESTART=Y
CLOPT="-A --
-n //chewei:3080 -m 2 -M 7 -x 5 -I 5 -T 60" 并且启动了,同时我在配置客户机WSNADDR环境变量,指向要连的tuxedo服务器,然后buildclient的时候加上 -w参数
出现客户端执行错误:
E:\bea\simpapp>simpcl wrwer1243
Can't send request to service TOUPPER
Tperrno = 6
服务端log错误:
163933.CHEWEI!WSH.1664.1464.0: 01-15-2003: Tuxedo Version 8.1 32-bit Windows.
163933.CHEWEI!WSH.1664.1464.0: WSNAT_CAT:1030: INFO: Work Station Handler joining application
164533.CHEWEI!WSH.1508.1644.0: WSNAT_CAT:1042: ERROR: tpcall() call failed, tperrno = 6
我用netstat -an 察看机台机子的连接情况
TCP 192.168.0.2:1037 192.168.0.5:3080 TIME_WAIT
simpcl.c源代码:
/* (c) 2003 BEA Systems, Inc. All Rights Reserved. */
/* 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 "@(#) samples/atmi/simpapp/simpcl.c $Revision: 1.5 $" */
#include <stdio.h>
#include "atmi.h" /* TUXEDO Header File */
#if defined(__STDC__) || defined(__cplusplus)
main(int argc, char *argv[])
#else
main(argc, argv)
int argc;
char *argv[];
#endif
{
char sendbuf, rcvbuf;
long sendlen, rcvlen;
int ret;
if(argc != 2) {
(void) fprintf(stderr, "Usage: simpcl string\n");
exit(1);
}
/* Attach to System/T as a Client Process */
if (tpinit((TPINIT *) NULL) == -1) {
(void) fprintf(stderr, "Tpinit failed\n");
exit(1);
}
sendlen = strlen(argv[1]);
/* Allocate STRING buffers for the request and the reply */
if((sendbuf = (char *) tpalloc("STRING", NULL, sendlen+1)) == NULL) {
(void) fprintf(stderr,"Error allocating send buffer\n");
tpterm();
exit(1);
}
if((rcvbuf = (char *) tpalloc("STRING", NULL, sendlen+1)) == NULL) {
(void) fprintf(stderr,"Error allocating receive buffer\n");
tpfree(sendbuf);
tpterm();
exit(1);
}
(void) strcpy(sendbuf, argv[1]);
/* Request the service TOUPPER, waiting for a reply */
ret = tpcall("TOUPPER", (char *)sendbuf, 0, (char **)&rcvbuf, &rcvlen, (long)0);
if(ret == -1) {
(void) fprintf(stderr, "Can't send request to service TOUPPER\n");
(void) fprintf(stderr, "Tperrno = %d\n", tperrno);
tpfree(sendbuf);
tpfree(rcvbuf);
tpterm();
exit(1);
}
(void) fprintf(stdout, "Returned string is: %s\n", rcvbuf);
/* Free Buffers & Detach from System/T */
tpfree(sendbuf);
tpfree(rcvbuf);
tpterm();
return(0);
}
1);
}
if((rcvbuf = (char *) tpalloc("STRING", NULL, sendlen+1)) == NULL) {
(void) fprintf(stderr,"Error allocating receive buffer\n");
tpfree(sendbuf);
tpterm();
exit(1);
}
(void) strcpy(sendbuf, argv[1]);
/* Request the service TOUPPER, waiting for a reply */
ret = tpcall("TOUPPER", (char *)sendbuf, 0, (char **)&rcvbuf, &rcvlen, (long)0);
if(ret == -1) {
(void) fprintf(stderr, "Can't send request to service TOUPPER\n");
(void) fprintf(stderr, "Tperrno = %d\n", tperrno);
tpfree(sendbuf);
tpfree(rcvbuf);
tpterm();
exit(1);
}
(void) fprintf(stdout, "Return
--转自