急:为什么我的远程客户端tpcall会出错?_MQ, Tuxedo及OLTP讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  MQ, Tuxedo及OLTP讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 3443 | 回复: 0   主题: 急:为什么我的远程客户端tpcall会出错?        下一篇 
koei666
注册用户
等级:新兵
经验:61
发帖:63
精华:0
注册:2012-1-9
状态:离线
发送短消息息给koei666 加好友    发送短消息息给koei666 发消息
发表于: IP:您无权察看 2014-10-14 9:54:54 | [全部帖] [楼主帖] 楼主

我做了一个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


--转自 北京联动北方科技有限公司




赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论