HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: RPC Question
Operating System - HP-UX
1830899
Members
1990
Online
110017
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2003 01:26 AM
11-05-2003 01:26 AM
RPC Question
Bear with me as I explain the problem ... many thanks in advance to anyone that can help ...
We are re-implementing a legacy application that uses RPC over TCP to communicate requests to the app from clients on other boxes. The legacy app was on SunOS - we are on HPUX. The legacy app, for some reason that I don't know, hardwired their RPC server to a specific port (which the customer could configure). They did, however, register the server with rpcbind.
I have successfully implemented (C++) the app using rpcbind with dynamic port assignment (used the svc_tp_create() API). The problem is that I cannot get it to work on a hard-wired port (as the legacy app does, and as the customer insists it must forever be done). I have tried several methods:
(1) The original code in the legacy app called svctcp_create() followed by svc_register(). The file descriptor bound to the fixed port was passed to svctcp_create(). Ignoring the man page warning about these APIs being obsolete, this compiles and initializes fine. rpcinfo reports the registered entry on the fixed port. But pinging the server with rpcinfo causes the error "RPC: Miscellaneous tli error - bad flags".
(2) Looking for alternate APIs that are not obsolete, I see svc_tli_create(). The man page warns that the HP implementation of RPC only supports XTI and TLI apps must be re-written. So that one won't work (I tried anyway).
(3) svc_fd_create() looks like it might also be an alternative, but the call fails.
So can anyone help me get this to work?
We are re-implementing a legacy application that uses RPC over TCP to communicate requests to the app from clients on other boxes. The legacy app was on SunOS - we are on HPUX. The legacy app, for some reason that I don't know, hardwired their RPC server to a specific port (which the customer could configure). They did, however, register the server with rpcbind.
I have successfully implemented (C++) the app using rpcbind with dynamic port assignment (used the svc_tp_create() API). The problem is that I cannot get it to work on a hard-wired port (as the legacy app does, and as the customer insists it must forever be done). I have tried several methods:
(1) The original code in the legacy app called svctcp_create() followed by svc_register(). The file descriptor bound to the fixed port was passed to svctcp_create(). Ignoring the man page warning about these APIs being obsolete, this compiles and initializes fine. rpcinfo reports the registered entry on the fixed port. But pinging the server with rpcinfo causes the error "RPC: Miscellaneous tli error - bad flags".
(2) Looking for alternate APIs that are not obsolete, I see svc_tli_create(). The man page warns that the HP implementation of RPC only supports XTI and TLI apps must be re-written. So that one won't work (I tried anyway).
(3) svc_fd_create() looks like it might also be an alternative, but the call fails.
So can anyone help me get this to work?
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2003 10:30 AM
11-06-2003 10:30 AM
Re: RPC Question
You can use svc_tli_create()
1) create a tbind structure
inSockTcp = t_open( "/dev/tcp", O_RDWR, &tinfo );
tbind = (struct t_bind *) t_alloc(inSockTcp, T_BIND, T_ADDR);
taddr = (short *) tbind->addr.buf;
taddr[0] = AF_INET;
taddr[1] = htons( (unsigned long) 9999);
taddr[2] = 0;
taddr[3] = 0;
tbind->qlen = 1;
tbind->addr.len=8;
Then use svc_tli_create() :
lcl_netcfg = getnetconfigent("tcp");
if ( lcl_netcfg == NULL ) {
fprintf( stderr, "Can not read netconfig database for udp.\n");
exit( 1 );
}
transp = svc_tli_create( inSockTcp, NULL, tbind, 0, 0 );
if ( transp == NULL ) {
fprintf( stderr, "Can not create TLI entry.\n");
exit(1);
}
Then register the service with svc_reg() :
if ( !svc_reg( (SVCXPRT *) transp, (unsigned long) 222222, (unsigned long) 22, dispatch, lcl_netcfg
) ) { fprintf( stderr, "Can not register service.\n" ); exit( 1 ); }
1) create a tbind structure
inSockTcp = t_open( "/dev/tcp", O_RDWR, &tinfo );
tbind = (struct t_bind *) t_alloc(inSockTcp, T_BIND, T_ADDR);
taddr = (short *) tbind->addr.buf;
taddr[0] = AF_INET;
taddr[1] = htons( (unsigned long) 9999);
taddr[2] = 0;
taddr[3] = 0;
tbind->qlen = 1;
tbind->addr.len=8;
Then use svc_tli_create() :
lcl_netcfg = getnetconfigent("tcp");
if ( lcl_netcfg == NULL ) {
fprintf( stderr, "Can not read netconfig database for udp.\n");
exit( 1 );
}
transp = svc_tli_create( inSockTcp, NULL, tbind, 0, 0 );
if ( transp == NULL ) {
fprintf( stderr, "Can not create TLI entry.\n");
exit(1);
}
Then register the service with svc_reg() :
if ( !svc_reg( (SVCXPRT *) transp, (unsigned long) 222222, (unsigned long) 22, dispatch, lcl_netcfg
) ) { fprintf( stderr, "Can not register service.\n" ); exit( 1 ); }
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP