MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / disconnect

Method disconnect

src/remote/server/server.cpp:2990–3135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2988
2989
2990void rem_port::disconnect(PACKET* sendL, PACKET* receiveL)
2991{
2992/**************************************
2993 *
2994 * d i s c o n n e c t
2995 *
2996 **************************************
2997 *
2998 * Functional description
2999 * We've lost the connection to the parent. Stop everything.
3000 *
3001 **************************************/
3002 Rdb* rdb = this->port_context;
3003
3004 if (this->port_flags & PORT_async)
3005 {
3006 if (!(this->port_flags & PORT_detached) &&
3007 rdb && rdb->rdb_port &&
3008 !(rdb->rdb_port->port_flags & (PORT_disconnect | PORT_detached)))
3009 {
3010 PACKET *packet = &rdb->rdb_packet;
3011 packet->p_operation = op_dummy;
3012 rdb->rdb_port->send(packet);
3013 }
3014 return;
3015 }
3016
3017 this->port_flags |= PORT_disconnect;
3018 this->port_z_data = false;
3019
3020 if (!rdb)
3021 {
3022 REMOTE_free_packet(this, sendL);
3023 REMOTE_free_packet(this, receiveL);
3024 this->disconnect();
3025 return;
3026 }
3027
3028 // For XNET we should send dummy op_disconnect packet
3029 // to wakeup async port handling events on client side.
3030 // For INET it's not necessary because INET client's async port
3031 // wakes up while server performs shutdown(socket) call on its async port.
3032 // See interface.cpp - event_thread().
3033
3034 PACKET *packet = &rdb->rdb_packet;
3035 if (this->port_async)
3036 {
3037 if (this->port_type == rem_port::XNET)
3038 {
3039 packet->p_operation = op_disconnect;
3040 this->port_async->send(packet);
3041 }
3042 this->port_async->port_flags |= PORT_disconnect;
3043 }
3044
3045 LocalStatus ls;
3046 CheckStatusWrapper status_vector(&ls);
3047 if (rdb->rdb_iface)

Callers 7

SRVR_multi_threadFunction · 0.45
aux_requestFunction · 0.45
process_packetFunction · 0.45
continue_authenticationFunction · 0.45
start_transactionMethod · 0.45
inet_connect_wait_threadFunction · 0.45
xnet_connect_wait_threadFunction · 0.45

Calls 11

REMOTE_free_packetFunction · 0.85
release_requestFunction · 0.70
release_sql_requestFunction · 0.70
release_transactionFunction · 0.70
release_eventFunction · 0.70
release_statementFunction · 0.70
sendMethod · 0.45
cancelOperationMethod · 0.45
rollbackMethod · 0.45
detachMethod · 0.45
hasDataMethod · 0.45

Tested by

no test coverage detected