From 272ebd125fba280b0713e9e50fa38d629cb30979 Mon Sep 17 00:00:00 2001 From: Eao3piq4e Date: Wed, 10 Aug 2022 18:37:51 +0800 Subject: [PATCH] Update mc_tcp.cpp --- .../cbb/communication/libcomm_core/mc_tcp.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gausskernel/cbb/communication/libcomm_core/mc_tcp.cpp b/src/gausskernel/cbb/communication/libcomm_core/mc_tcp.cpp index b07a5065..80bc9410 100644 --- a/src/gausskernel/cbb/communication/libcomm_core/mc_tcp.cpp +++ b/src/gausskernel/cbb/communication/libcomm_core/mc_tcp.cpp @@ -629,6 +629,17 @@ int mc_tcp_addr_init(const char* host, int port, struct sockaddr_storage* ss, in return (error == 1) ? 0 : error; } +/* +function name: mc_tcp_connect_nonblock +description: This function is used to create a socket and establish a connection with the port of the specified host + in non blocking mode. +arguments: The first parameter specifies a specific host, and the second parameter specifies a specific port of the host. +return value: If the connection is successfully established, the file descriptor of the socket connected to the port of the + specified host is returned; otherwise, - 1 is returned. +note: none +date: 2022/8/10 +contact tel: 18720816902 +*/ int mc_tcp_connect_nonblock(const char* host, int port) { int sockfd, n;