Re: PRO C on an HP using TCP/IP

From: Keith E. Moore <kmacs_at_gandalf.kmacs.com>
Date: 1996/10/06
Message-ID: <slrn55duvt.2ng.kmacs_at_gandalf.kmacs.com>#1/1


On Thu, 03 Oct 1996 04:34:52 GMT, PROBRIEN_at_NETCOM.COM <PROBRIEN_at_NETCOM.COM> wrote:
>I've inherited a C application that was running fine on an HP9000
>running HP UX A.09.04 with Oracle verion 7.016 using PRO C version
>1.5. The program communicates with our mainframe using TCP/IP.
>
>We recently upgraded the box to Oracle version 7.16 and PRO C version
>1.6 and the app failed. It will run from 30 to 45 minutes before it
>fails. The following is a snippet of code where the error occurs:
>
> create_socket(&SocketNumber) // This works every time
>
> bind_socket(SocketNumber,&SocketAddress) // This never fails
>
> listen(SocketNumber,100) // Works also
>
> recv_socket(SocketNumber,message,SLEEP,0) // This works for a while
>// then returns a -1 (Receive error).
>// After this error I have to stop then restart the application.

Since you seem to have the source, and can recompile it, add this line to wherever you catch the error:

	if(recv_socket(SocketNumber,message,SLEEP,0) == -1)
		perror( "recv_socket" ); 

This will print a string to the screen which should further explain what is happening (timeout, bad file handle, etc).

Have you upgraded anything else? this should not really be affected by Oracle, or Pro*C, this is more a function of the OS and C compiler, unless Oracle is somehow affecting your TCP/IP.

  • Keith Moore President KMA Computer Solutions, Inc.
-- 
/*----C/C++--Java--COBOL--Pro*C/Pro*Cobol--OCI--Java--Delphi--ODBC----* 
 *        When the project must be saved at all costs:                *
 * KMA Computer Solutions, Inc.   Project Troubleshooting/Recovery    *
 *---------Linux---AIX---HPUX---SYSV---Novell---NT---OS/2---'95-------*/
Received on Sun Oct 06 1996 - 00:00:00 CEST

Original text of this message