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

Function INET_connect

src/remote/inet.cpp:862–1062  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

860}
861
862rem_port* INET_connect(const TEXT* name,
863 PACKET* packet,
864 USHORT flag,
865 ClumpletReader* dpb,
866 RefPtr<const Config>* config,
867 int af)
868{
869/**************************************
870 *
871 * I N E T _ c o n n e c t
872 *
873 **************************************
874 *
875 * Functional description
876 * Establish half of a communication link. If a connect packet is given,
877 * the connection is on behalf of a remote interface. Otherwise the connect
878 * is for a server process.
879 *
880 **************************************/
881#ifdef DEBUG
882 {
883 if (INET_trace & TRACE_operations)
884 {
885 fprintf(stdout, "INET_connect\n");
886 fflush(stdout);
887 }
888 INET_start_time = inet_debug_timer();
889 // CVC: I don't see the point in replacing this with fb_utils::readenv().
890 const char* p = getenv("INET_force_error");
891 if (p != NULL) {
892 INET_force_error = atoi(p);
893 }
894 }
895#endif
896
897 rem_port* port = alloc_port(NULL);
898 if (config)
899 {
900 port->port_config = *config;
901 }
902 REMOTE_get_timeout_params(port, dpb);
903
904 string host;
905 string protocol;
906
907 if ((!name || !name[0]) && !packet)
908 {
909 name = port->getPortConfig()->getRemoteBindAddress();
910 }
911
912 if (name)
913 {
914 host = name;
915 const FB_SIZE_T pos = host.find("/");
916
917 if (pos != string::npos)
918 {
919 protocol = host.substr(pos + 1);

Callers 3

inet_try_connectFunction · 0.85
CLIB_ROUTINE mainFunction · 0.85
inet_connect_wait_threadFunction · 0.85

Calls 15

fflushFunction · 0.85
inet_debug_timerFunction · 0.85
REMOTE_make_stringFunction · 0.85
inet_gen_errorFunction · 0.85
GdsClass · 0.85
socketFunction · 0.85
listener_socketFunction · 0.85
setKeepAliveFunction · 0.85
setNoNagleOptionFunction · 0.85
get_peer_infoFunction · 0.85
SOCLOSEFunction · 0.85

Tested by

no test coverage detected