1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems, Inc.
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 2 of the License.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
#define LIBDRIZZLE_ERRMSG_SIZE 512
26
#define LIBDRIZZLE_SQLSTATE_LENGTH 5
28
namespace drizzle_plugin {
34
unsigned char *buff,*buff_end,*write_pos,*read_pos;
35
unsigned long remain_in_buf,length, buf_length, where_b;
36
unsigned long max_packet,max_packet_size;
37
unsigned int pkt_nr,compress_pkt_nr;
38
unsigned int write_timeout_;
39
unsigned int read_timeout_;
40
unsigned int retry_count;
43
unsigned int last_errno;
46
void init(int sock, uint32_t buffer_length);
50
bool peer_addr(char *buf, size_t buflen, uint16_t&);
51
void keepalive(bool flag);
53
void set_write_timeout(uint32_t timeout);
54
void set_read_timeout(uint32_t timeout);
55
bool write(const void*, size_t);
56
bool write_command(unsigned char command, data_ref header, data_ref body);
61
} /* namespace drizzle_plugin */