SpiecsEngine
 
Loading...
Searching...
No Matches

◆ Connect()

void Spices::Net::Socket::Connect ( InetAddress * connectAddress) const

Connect to socket.

Parameters
connectAddressConnection address.

Definition at line 62 of file Socket.cpp.

63 {
65
66 int r = ::connect(m_SocketFd, reinterpret_cast<sockaddr*>(connectAddress->GetSockAddress()), sizeof(sockaddr_in));
67
68 if (r < 0)
69 {
70 // Non-Blocking usually return this error code.
71 if (WSAGetLastError() == 10035)
72 {
73 return;
74 }
75
76 std::stringstream ss;
77 ss << "Socket::Connect failed, socket fd: " << m_SocketFd << " Error: " << WSAGetLastError();
78
79 SPICES_CORE_CRITICAL(ss.str())
80 }
81 }
#define SPICES_PROFILE_ZONE
SOCKET m_SocketFd
This socket fd.
Definition Socket.h:142

Referenced by SpicesTest::BufferTest::StartClient(), SpicesTest::SocketTest::StartClient(), SpicesTest::TEST(), and SpicesTest::TEST().