Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Ellery <mellery at yahoo dot com>
Subject: Re: CT-lib Error halts script
Date: Mar 18 1999 3:48PM

My message handler (client callback) looks like:

sub _messageHandler {
  my ($layer,$origin,$severity,$number,$msg,$osmsg)=@_;

  my $out = "\nCT-lib error: Msg->$msg\nLayer->$layer Origin->$origin
Severity->$severity\n"      if ( $msg   ne "" );
  $out    = "\nCT-lib error: OSmsg->$osmsg\nLayer->$layer
Origin->$origin Severity->$severity\n"  if ( $osmsg ne "" );

  if ($severity > 0) {
    if ($cmDb::Logging) {
      # Call the specified logging routine by reference
  return CS_SUCCEED;

} # End of _messageHandler

..which I think is OK.

I am finding, upon further investigation, that the script appears to
halt the NEXT time that it tries to establish a connection to the DB
after one failed with the message below.  That is, if I get this
message once, then I appear to get stuck the next time I try to do a
ct_connect().  By the way, I am using a little home-grown package to
handle the DB connection and other CTlib calls...the heart of the
new() method there is just:

  my $dbh=Sybase::CTlib->ct_connect($user, $password, $server, $0);
  return undef if (($dbh < 0) || (! $dbh)); # Get out if not

Does that seem reasonable?  I've looked in the Sybperl docs and I
guess I'm not entirely sure what to expect back from ct_connect() if
there is a problem...

Mike Ellery

---Michael Peppler  wrote:
> Michael Ellery writes:
>  > Folks-
>  > 
>  > I periodically get the following error from CT-lib when I try to
>  > establish a connection:
>  > 
>  > ------------------------------------------
>  > CT-lib error: Msg->ct_connect(): network packet layer: internal net
>  > library error: Attempt to use invalid address handle Layer->5
>  > Origin->3 Severity->4
>  > ------------------------------------------
>  > 
>  > (as you can see, I have a callback handler to grab these messages.)
>  > 
>  > The message itself isn't such a problem but be script basically
>  > dead whenever I get such a message.  It doesn't die and it doesn't
>  > proceed--it just stops.  
> What does your client callback return?
> The callbacks MUST return CS_SUCCEED. Other values will most probably
> cause the script to exit.
> Michael
> -- 
> Michael Peppler         -||-  Data Migrations Inc.
>    -||-
> Int. Sybase User Group  -||-
> Sybase on Linux mailing list:

* Michael Ellery                            *
*                         *

Get your free address at