MCPcopy Create free account
hub / github.com/anjo76/angelscript / IsActive

Method IsActive

sdk/add_on/scriptsocket/scriptsocket.cpp:273–289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271}
272
273bool CScriptSocket::IsActive() const
274{
275 if (m_socket == -1)
276 return false;
277
278 int error_code = 0;
279 int error_code_size = sizeof(error_code);
280 int r = getsockopt(m_socket, SOL_SOCKET, SO_ERROR, (char*)&error_code, &error_code_size);
281 if (r < 0 || error_code != 0)
282 {
283 // If an error occurred just close the socket
284 const_cast<CScriptSocket*>(this)->Close();
285 return false;
286 }
287
288 return true;
289}
290
291static CScriptSocket* CScriptSocket_Factory()
292{

Callers

nothing calls this directly

Calls 1

CloseMethod · 0.45

Tested by

no test coverage detected