Sybase::TdsSocket - A module containing tds lowlevel functions
my $tdssocket = Sybase::TdsSocket->new($socket); $tdssocket->set_packetsize(512); $tdssocket->packet_type(TDS_BUF_RESPONSE); my ($length, $header, $data) = $tdssocket->read_packet(); $tdssocket->write($data);
Parameters:
Example:
$tdssocket = Sybase::TdsSocket->new('myserver');
Sets the packet type for the next outgoing packets.
The type, should be one of the following: TDS_BUF_RESPONSE
my $res = $tdssocket->packet_type(TDS_BUF_RESPONSE);
An IO::Socket object from which the data will be read.
Returnvalues:
The length of the packet in bytes.
The 8 byte tds header
The data.
my ($len, $header, $data) = $tdssocket->read_packet;
Accumulates data in a buffer and sends a tds packet if necessary.
The packet Data
True for success, false for failure.
my $res = $tdssocket->write($data);
Sends all data in buffer and truncates it.
None.
my $res = $tdssocket->flush;
Sends a done token to the client
Status is a bitmap with the following meaning:
0x0000 done final Result complete, successful 0x0001 done more Result complete, more results to follow 0x0002 done error Error occured in current command 0x0004 done inxact Transaction in progress for command 0x0008 done proc Result comes from a stored procedure 0x0010 done count 0x0020 done attn to acknowlegde an attention 0x0040 done event part of event notification
Status of the current transaction is one of the following:
0 not in tran 1 tran succeed 2 tran in progress 3 statement abort 4 tran abort
$tdssocket->send_done($status);
Sends a eed token to the client
Message number.
Class or severity.
Text of the message.
Servername
Name of the procedure (optional)
Line of the procedure (optional)
$tdssocket->send_eed(12345, 10, 0, 'This is a warning');
Gets ip and port from interfaces file
IP and Portnumber
undef and errortext on failure.
my ($ip, $port) = $tdssocket->server_info('myserver');
2 POD Errors
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head2'
To install Sybase::TdsServer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sybase::TdsServer
CPAN shell
perl -MCPAN -e shell install Sybase::TdsServer
For more information on module installation, please visit the detailed CPAN module installation guide.