MySQL  8.0.18
Source Code Documentation
xcom_transport.c File Reference
#include <assert.h>
#include <errno.h>
#include <limits.h>
#include <math.h>
#include <rpc/rpc.h>
#include <stdlib.h>
#include <string.h>
#include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_profile.h"
#include "my_compiler.h"
#include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/node_connection.h"
#include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/node_list.h"
#include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/node_no.h"
#include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/retry.h"
#include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/server_struct.h"
#include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/simset.h"
#include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/site_def.h"
#include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/site_struct.h"
#include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/sock_probe.h"
#include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/synode_no.h"
#include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/task.h"
#include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/task_debug.h"
#include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/task_net.h"
#include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/task_os.h"
#include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/x_platform.h"
#include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_base.h"
#include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_common.h"
#include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_detector.h"
#include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_memory.h"
#include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_msg_queue.h"
#include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_statistics.h"
#include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_transport.h"
#include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_vp_str.h"
#include "plugin/group_replication/libmysqlgcs/xdr_gen/xcom_vp.h"

Macros

#define MY_XCOM_PROTO   x_1_6
 
#define SERVER_MAX   (2 * NSERVERS)
 
#define INLINE_T   int32_t
 
#define CRC32CSTART   0xFFFFFFFF
 
#define TAG_START   313
 
#define TERMINATE_CLIENT(ep)
 

Functions

static void shut_srv (server *s)
 
static int pm (xcom_port port)
 
int set_xcom_socket_accept_cb (xcom_socket_accept_cb x)
 
void init_xcom_transport (xcom_port listen_port)
 
void reset_srv_buf (srv_buf *sb)
 
static void alive (server *s)
 
static u_int srv_buf_capacity (srv_buf *sb)
 
static u_int srv_buf_free_space (srv_buf *sb)
 
static u_int srv_buf_buffered (srv_buf *sb)
 
static char * srv_buf_extract_ptr (srv_buf *sb)
 
static char * srv_buf_insert_ptr (srv_buf *sb)
 
static void advance_extract_ptr (srv_buf *sb, u_int len)
 
static u_int get_srv_buf (srv_buf *sb, char *data, u_int len)
 
static void advance_insert_ptr (srv_buf *sb, u_int len)
 
static u_int put_srv_buf (srv_buf *sb, char *data, u_int len)
 
int flush_srv_buf (server *s, int64_t *ret)
 
int is_new_node_eligible_for_ipv6 (xcom_proto incoming_proto, const site_def *current_site_def)
 Checks if an incoming node is eligible to enter the group. More...
 
static int _send_msg (server *s, pax_msg *p, node_no to, int64_t *ret)
 
void write_protoversion (unsigned char *buf, xcom_proto proto_vers)
 
xcom_proto read_protoversion (unsigned char *p)
 
int check_protoversion (xcom_proto x_proto, xcom_proto negotiated)
 
int send_proto (connection_descriptor *con, xcom_proto x_proto, x_msg_type x_type, unsigned int tag, int64_t *ret)
 
int apply_xdr (xcom_proto x_proto, void *buff, uint32_t bufflen, xdrproc_t xdrfunc, void *xdrdata, enum xdr_op op)
 
void dbg_app_data (app_data_ptr a)
 
static bool_t x_putlong (XDR *xdrs, const long *longp)
 
static bool_t x_putbytes (XDR *xdrs, const char *bp, u_int len)
 
static u_int x_getpostn (const XDR *xdrs)
 
static bool_t x_setpostn (XDR *xdrs, u_int len)
 
static INLINE_Tx_inline (XDR *xdrs, u_int len)
 
static int harmless (void)
 
static void x_destroy (XDR *xdrs)
 
static uint64_t xdr_proto_sizeof (xcom_proto x_proto, xdrproc_t func, void *data)
 
static int serialize (void *p, xcom_proto x_proto, uint32_t *out_len, xdrproc_t xdrfunc, char **out_buf)
 
static int old_proto_knows (xcom_proto x_proto, pax_op op)
 
int serialize_msg (pax_msg *p, xcom_proto x_proto, uint32_t *buflen, char **buf)
 
int deserialize_msg (pax_msg *p, xcom_proto x_proto, char *buf, uint32_t buflen)
 
void init_crc32c ()
 
uint32_t crc32c_hash (char *buf, char *end)
 
static servermksrv (char *srv, xcom_port port)
 
static serveraddsrv (char *srv, xcom_port port)
 
static void rmsrv (int i)
 
static void init_collect ()
 
void get_all_site_defs (site_def ***s, uint32_t *n)
 
static void mark_site_servers (site_def *site)
 
static void mark ()
 
static void sweep ()
 
void garbage_collect_servers ()
 
static void freesrv (server *s)
 
double server_active (site_def const *s, node_no i)
 
int srv_ref (server *s)
 
int srv_unref (server *s)
 
int tcp_server (task_arg arg)
 
void server_detected (server *s)
 Updates timestamp of server. More...
 
static int dial (server *s)
 
int send_msg (server *s, node_no from, node_no to, uint32_t group_id, pax_msg *p)
 
static int _send_server_msg (site_def const *s, node_no to, pax_msg *p)
 
int send_server_msg (site_def const *s, node_no to, pax_msg *p)
 
static int send_loop (site_def const *s, node_no max, pax_msg *p, const char *dbg)
 
int send_to_all_site (site_def const *s, pax_msg *p, const char *dbg)
 
int send_to_self_site (site_def const *s, pax_msg *p)
 
int send_to_all (pax_msg *p, const char *dbg)
 
static int send_other_loop (site_def const *s, pax_msg *p, const char *dbg)
 
int send_to_others (site_def const *s, pax_msg *p, const char *dbg)
 
int send_to_someone (site_def const *s, pax_msg *p, const char *dbg)
 
int send_to_acceptors (pax_msg *p, const char *dbg)
 
static int read_bytes (connection_descriptor const *rfd, char *p, uint32_t n, server *s, int64_t *ret)
 Reads n bytes from connection rfd without buffering reads. More...
 
static int buffered_read_bytes (connection_descriptor const *rfd, srv_buf *buf, char *p, uint32_t n, server *s, int64_t *ret)
 Reads n bytes from connection rfd with buffering reads. More...
 
void get_header_1_0 (unsigned char header_buf[], uint32_t *msgsize, x_msg_type *x_type, unsigned int *tag)
 
void put_header_1_0 (unsigned char header_buf[], uint32_t msgsize, x_msg_type x_type, unsigned int tag)
 
int read_msg (connection_descriptor *rfd, pax_msg *p, server *s, int64_t *ret)
 Reads message from connection rfd without buffering reads. More...
 
int buffered_read_msg (connection_descriptor *rfd, srv_buf *buf, pax_msg *p, server *s, int64_t *ret)
 Reads message from connection rfd with buffering reads. More...
 
int recv_proto (connection_descriptor const *rfd, xcom_proto *x_proto, x_msg_type *x_type, unsigned int *tag, int64_t *ret)
 
int tag_check (unsigned int tag1, unsigned int tag2)
 
static unsigned int incr_tag (unsigned int tag)
 
static void start_protocol_negotiation (channel *outgoing)
 
int sender_task (task_arg arg)
 
int local_sender_task (task_arg arg)
 
static serverfind_server (server *table[], int n, char *name, xcom_port port)
 
void update_servers (site_def *s, cargo_type operation)
 
void invalidate_servers (const site_def *old_site_def, const site_def *new_site_def)
 
int tcp_reaper_task (task_arg arg)
 
static int client_dial (char *srv, xcom_port port, connection_descriptor *con)
 
int client_task (task_arg arg)
 
void close_connection (connection_descriptor *con)
 
void shutdown_connection (connection_descriptor *con)
 
void reset_connection (connection_descriptor *con)
 
xcom_proto common_xcom_version (site_def const *site)
 
xcom_proto set_latest_common_proto (xcom_proto x_proto)
 
xcom_proto get_latest_common_proto ()
 
xcom_proto negotiate_protocol (xcom_proto proto_vers)
 
bool_t xdr_node_address_with_1_0 (XDR *xdrs, node_address *objp)
 
bool_t xdr_node_list_1_1 (XDR *xdrs, node_list_1_1 *objp)
 
bool_t xdr_checked_data (XDR *xdrs, checked_data *objp)
 
bool_t xdr_pax_msg (XDR *xdrs, pax_msg *objp)
 
bool_t xdr_config (XDR *xdrs, config *objp)
 
xcom_proto minimum_ipv6_version ()
 Returns the version from which nodes are able to speak IPv6. More...
 
int get_ip_and_port (char *address, char ip[IP_MAX_SIZE], xcom_port *port)
 Get the ip and port object from a given address in the authorized input format. More...
 

Variables

xcom_proto const my_min_xcom_version
 
xcom_proto const my_xcom_version
 
static int const NAGLE = 0
 
int xcom_shutdown
 
static xcom_port xcom_listen_port = 0
 
static xcom_socket_accept_cb xcom_socket_accept_callback = NULL
 
static uint32_t crc_table [256]
 
static serverall_servers [SERVER_MAX]
 
static int maxservers = 0
 
static xcom_proto latest_common_proto = MY_XCOM_PROTO
 

Macro Definition Documentation

◆ CRC32CSTART

#define CRC32CSTART   0xFFFFFFFF

◆ INLINE_T

#define INLINE_T   int32_t

◆ MY_XCOM_PROTO

#define MY_XCOM_PROTO   x_1_6

◆ SERVER_MAX

#define SERVER_MAX   (2 * NSERVERS)

◆ TAG_START

#define TAG_START   313

◆ TERMINATE_CLIENT

#define TERMINATE_CLIENT (   ep)
Value:
{ \
if (ep->s->crash_on_error) abort(); \
}
#define TERMINATE
Definition: task.h:300

Function Documentation

◆ _send_msg()

static int _send_msg ( server s,
pax_msg *  p,
node_no  to,
int64_t *  ret 
)
static

◆ _send_server_msg()

static int _send_server_msg ( site_def const *  s,
node_no  to,
pax_msg *  p 
)
inlinestatic

◆ addsrv()

static server* addsrv ( char *  srv,
xcom_port  port 
)
static

◆ advance_extract_ptr()

static void advance_extract_ptr ( srv_buf sb,
u_int  len 
)
inlinestatic

◆ advance_insert_ptr()

static void advance_insert_ptr ( srv_buf sb,
u_int  len 
)
inlinestatic

◆ alive()

static void alive ( server s)
static

◆ apply_xdr()

int apply_xdr ( xcom_proto  x_proto,
void *  buff,
uint32_t  bufflen,
xdrproc_t  xdrfunc,
void *  xdrdata,
enum xdr_op  op 
)

◆ buffered_read_bytes()

static int buffered_read_bytes ( connection_descriptor const *  rfd,
srv_buf buf,
char *  p,
uint32_t  n,
server s,
int64_t *  ret 
)
static

Reads n bytes from connection rfd with buffering reads.

Parameters
[in]rfdPointer to open connection.
[in,out]bufUsed for buffering reads. Originally initialized by caller, maintained by buffered_read_bytes.
[out]pOutput buffer.
[in]nNumber of bytes to read
[out]sPointer to server.
[out]retNumber of bytes read, or -1 if failure.
Returns
Return values
0if task should terminate.
1if it should continue.

◆ buffered_read_msg()

int buffered_read_msg ( connection_descriptor rfd,
srv_buf buf,
pax_msg *  p,
server s,
int64_t *  ret 
)

Reads message from connection rfd with buffering reads.

Parameters
[in]rfdPointer to open connection.
[in,out]bufUsed for buffering reads.
[out]pOutput buffer.
[out]sPointer to server. Server timestamp updated if not 0.
[out]retNumber of bytes read, or -1 if failure.
Returns
Return values
0if task should terminate.
1if it should continue.

◆ check_protoversion()

int check_protoversion ( xcom_proto  x_proto,
xcom_proto  negotiated 
)

◆ client_dial()

static int client_dial ( char *  srv,
xcom_port  port,
connection_descriptor con 
)
static

◆ client_task()

int client_task ( task_arg  arg)

◆ close_connection()

void close_connection ( connection_descriptor con)

◆ common_xcom_version()

xcom_proto common_xcom_version ( site_def const *  site)

◆ crc32c_hash()

uint32_t crc32c_hash ( char *  buf,
char *  end 
)

◆ dbg_app_data()

void dbg_app_data ( app_data_ptr  a)

◆ deserialize_msg()

int deserialize_msg ( pax_msg *  p,
xcom_proto  x_proto,
char *  buf,
uint32_t  buflen 
)

◆ dial()

static int dial ( server s)
static

◆ find_server()

static server* find_server ( server table[],
int  n,
char *  name,
xcom_port  port 
)
static

◆ flush_srv_buf()

int flush_srv_buf ( server s,
int64_t *  ret 
)

◆ freesrv()

static void freesrv ( server s)
static

◆ garbage_collect_servers()

void garbage_collect_servers ( )

◆ get_all_site_defs()

void get_all_site_defs ( site_def ***  s,
uint32_t *  n 
)

◆ get_header_1_0()

void get_header_1_0 ( unsigned char  header_buf[],
uint32_t *  msgsize,
x_msg_type x_type,
unsigned int *  tag 
)

◆ get_ip_and_port()

int get_ip_and_port ( char *  address,
char  ip[IP_MAX_SIZE],
xcom_port port 
)

Get the ip and port object from a given address in the authorized input format.

For IP v4 is IP (or) NAME:PORT and for IPv6 is [IP (or) NAME]:PORT

Parameters
addressinput address to parse
ipthe resulting IP or Name
portthe resulting port
Returns
int true (1) in case of parse error

◆ get_latest_common_proto()

xcom_proto get_latest_common_proto ( )

◆ get_srv_buf()

static u_int get_srv_buf ( srv_buf sb,
char *  data,
u_int  len 
)
static

◆ harmless()

static int harmless ( void  )
static

◆ incr_tag()

static unsigned int incr_tag ( unsigned int  tag)
inlinestatic

◆ init_collect()

static void init_collect ( )
static

◆ init_crc32c()

void init_crc32c ( )

◆ init_xcom_transport()

void init_xcom_transport ( xcom_port  listen_port)

◆ invalidate_servers()

void invalidate_servers ( const site_def old_site_def,
const site_def new_site_def 
)

◆ is_new_node_eligible_for_ipv6()

int is_new_node_eligible_for_ipv6 ( xcom_proto  incoming_proto,
const site_def current_site_def 
)

Checks if an incoming node is eligible to enter the group.

This function checks if a new node entering the group is able to be part of it. This is needed duw to downgrade procedures to server versions that do not speak IPv6. One wil check if:

  • Our server is being contacted by a server that has a lower version than the IPv6 baseline
  • Check if the current configuration is all reachable by an IPv4 node

If all of the above hold true we are able to proceed and add the node. Else, we must fail.

Returns
1 in case of success.

◆ local_sender_task()

int local_sender_task ( task_arg  arg)

◆ mark()

static void mark ( )
static

◆ mark_site_servers()

static void mark_site_servers ( site_def site)
static

◆ minimum_ipv6_version()

xcom_proto minimum_ipv6_version ( )

Returns the version from which nodes are able to speak IPv6.

Returns
xcom_proto the version from which nodes are able to speak IPv6

◆ mksrv()

static server* mksrv ( char *  srv,
xcom_port  port 
)
static

◆ negotiate_protocol()

xcom_proto negotiate_protocol ( xcom_proto  proto_vers)

◆ old_proto_knows()

static int old_proto_knows ( xcom_proto  x_proto,
pax_op  op 
)
inlinestatic

◆ pm()

static int pm ( xcom_port  port)
static

◆ put_header_1_0()

void put_header_1_0 ( unsigned char  header_buf[],
uint32_t  msgsize,
x_msg_type  x_type,
unsigned int  tag 
)

◆ put_srv_buf()

static u_int put_srv_buf ( srv_buf sb,
char *  data,
u_int  len 
)
static

◆ read_bytes()

static int read_bytes ( connection_descriptor const *  rfd,
char *  p,
uint32_t  n,
server s,
int64_t *  ret 
)
static

Reads n bytes from connection rfd without buffering reads.

Parameters
[in]rfdPointer to open connection.
[out]pOutput buffer.
[in]nNumber of bytes to read.
[out]sPointer to server.
[out]retNumber of bytes read, or -1 if failure.
Returns
Return values
0if task should terminate.
1if it should continue.

◆ read_msg()

int read_msg ( connection_descriptor rfd,
pax_msg *  p,
server s,
int64_t *  ret 
)

Reads message from connection rfd without buffering reads.

Parameters
[in]rfdPointer to open connection.
[out]pOutput buffer.
[in,out]sPointer to server. Server timestamp updated if not 0.
[in,out]retNumber of bytes read, or -1 if failure.
Returns
Return values
0if task should terminate.
1if it should continue.

◆ read_protoversion()

xcom_proto read_protoversion ( unsigned char *  p)

◆ recv_proto()

int recv_proto ( connection_descriptor const *  rfd,
xcom_proto x_proto,
x_msg_type x_type,
unsigned int *  tag,
int64_t *  ret 
)

◆ reset_connection()

void reset_connection ( connection_descriptor con)

◆ reset_srv_buf()

void reset_srv_buf ( srv_buf sb)

◆ rmsrv()

static void rmsrv ( int  i)
static

◆ send_loop()

static int send_loop ( site_def const *  s,
node_no  max,
pax_msg *  p,
const char *  dbg 
)
inlinestatic

◆ send_msg()

int send_msg ( server s,
node_no  from,
node_no  to,
uint32_t  group_id,
pax_msg *  p 
)

◆ send_other_loop()

static int send_other_loop ( site_def const *  s,
pax_msg *  p,
const char *  dbg 
)
inlinestatic

◆ send_proto()

int send_proto ( connection_descriptor con,
xcom_proto  x_proto,
x_msg_type  x_type,
unsigned int  tag,
int64_t *  ret 
)

◆ send_server_msg()

int send_server_msg ( site_def const *  s,
node_no  to,
pax_msg *  p 
)

◆ send_to_acceptors()

int send_to_acceptors ( pax_msg *  p,
const char *  dbg 
)

◆ send_to_all()

int send_to_all ( pax_msg *  p,
const char *  dbg 
)

◆ send_to_all_site()

int send_to_all_site ( site_def const *  s,
pax_msg *  p,
const char *  dbg 
)

◆ send_to_others()

int send_to_others ( site_def const *  s,
pax_msg *  p,
const char *  dbg 
)

◆ send_to_self_site()

int send_to_self_site ( site_def const *  s,
pax_msg *  p 
)

◆ send_to_someone()

int send_to_someone ( site_def const *  s,
pax_msg *  p,
const char *  dbg 
)

◆ sender_task()

int sender_task ( task_arg  arg)

◆ serialize()

static int serialize ( void *  p,
xcom_proto  x_proto,
uint32_t *  out_len,
xdrproc_t  xdrfunc,
char **  out_buf 
)
static

◆ serialize_msg()

int serialize_msg ( pax_msg *  p,
xcom_proto  x_proto,
uint32_t *  buflen,
char **  buf 
)

◆ server_active()

double server_active ( site_def const *  s,
node_no  i 
)

◆ server_detected()

void server_detected ( server s)

Updates timestamp of server.

Parameters
[in]sPointer to server.

◆ set_latest_common_proto()

xcom_proto set_latest_common_proto ( xcom_proto  x_proto)

◆ set_xcom_socket_accept_cb()

int set_xcom_socket_accept_cb ( xcom_socket_accept_cb  x)

◆ shut_srv()

static void shut_srv ( server s)
static

◆ shutdown_connection()

void shutdown_connection ( connection_descriptor con)

◆ srv_buf_buffered()

static u_int srv_buf_buffered ( srv_buf sb)
static

◆ srv_buf_capacity()

static u_int srv_buf_capacity ( srv_buf sb)
static

◆ srv_buf_extract_ptr()

static char* srv_buf_extract_ptr ( srv_buf sb)
static

◆ srv_buf_free_space()

static u_int srv_buf_free_space ( srv_buf sb)
static

◆ srv_buf_insert_ptr()

static char* srv_buf_insert_ptr ( srv_buf sb)
static

◆ srv_ref()

int srv_ref ( server s)

◆ srv_unref()

int srv_unref ( server s)

◆ start_protocol_negotiation()

static void start_protocol_negotiation ( channel outgoing)
static

◆ sweep()

static void sweep ( )
static

◆ tag_check()

int tag_check ( unsigned int  tag1,
unsigned int  tag2 
)
inline

◆ tcp_reaper_task()

int tcp_reaper_task ( task_arg  arg)

◆ tcp_server()

int tcp_server ( task_arg  arg)

◆ update_servers()

void update_servers ( site_def s,
cargo_type  operation 
)

◆ write_protoversion()

void write_protoversion ( unsigned char *  buf,
xcom_proto  proto_vers 
)

◆ x_destroy()

static void x_destroy ( XDR xdrs)
static

◆ x_getpostn()

static u_int x_getpostn ( const XDR xdrs)
static

◆ x_inline()

static INLINE_T* x_inline ( XDR xdrs,
u_int  len 
)
static

◆ x_putbytes()

static bool_t x_putbytes ( XDR xdrs,
const char *  bp,
u_int  len 
)
static

◆ x_putlong()

static bool_t x_putlong ( XDR xdrs,
const long *  longp 
)
static

◆ x_setpostn()

static bool_t x_setpostn ( XDR xdrs,
u_int  len 
)
static

◆ xdr_checked_data()

bool_t xdr_checked_data ( XDR xdrs,
checked_data *  objp 
)

◆ xdr_config()

bool_t xdr_config ( XDR xdrs,
config objp 
)

◆ xdr_node_address_with_1_0()

bool_t xdr_node_address_with_1_0 ( XDR xdrs,
node_address *  objp 
)

◆ xdr_node_list_1_1()

bool_t xdr_node_list_1_1 ( XDR xdrs,
node_list_1_1 *  objp 
)

◆ xdr_pax_msg()

bool_t xdr_pax_msg ( XDR xdrs,
pax_msg *  objp 
)

◆ xdr_proto_sizeof()

static uint64_t xdr_proto_sizeof ( xcom_proto  x_proto,
xdrproc_t  func,
void *  data 
)
static

Variable Documentation

◆ all_servers

server* all_servers[SERVER_MAX]
static

◆ crc_table

uint32_t crc_table[256]
static

◆ latest_common_proto

xcom_proto latest_common_proto = MY_XCOM_PROTO
static

◆ maxservers

int maxservers = 0
static

◆ my_min_xcom_version

xcom_proto const my_min_xcom_version
Initial value:
=
Definition: xcom_proto_enum.h:27

◆ my_xcom_version

xcom_proto const my_xcom_version
Initial value:
=
#define MY_XCOM_PROTO
Definition: xcom_transport.c:74

◆ NAGLE

int const NAGLE = 0
static

◆ xcom_listen_port

xcom_port xcom_listen_port = 0
static

◆ xcom_shutdown

int xcom_shutdown

◆ xcom_socket_accept_callback

xcom_socket_accept_cb xcom_socket_accept_callback = NULL
static