MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / doShutdown

Method doShutdown

source/core/StarSocket.cpp:237–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237void Socket::doShutdown() {
238 if (m_socketMode <= SocketMode::Shutdown)
239 return;
240
241 // Set socket mode first so that if this causes an exception the exception
242 // handlers know the socket is being shut down.
243 m_socketMode = SocketMode::Shutdown;
244
245 if (m_impl->socketDesc > 0) {
246#ifdef STAR_SYSTEM_FAMILY_WINDOWS
247 ::shutdown(m_impl->socketDesc, SD_BOTH);
248#else
249 ::shutdown(m_impl->socketDesc, SHUT_RDWR);
250#endif
251 }
252}
253
254void Socket::doClose() {
255 if (m_socketMode == SocketMode::Closed)

Callers 1

pollMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected