MCPcopy Create free account
hub / github.com/dermesser/libsocket / destroy

Method destroy

C++/socket.cpp:72–80  ·  view source on GitHub ↗

* @brief Destroys a socket. * * @retval 0 Fine! * @retval <0 Most likely the socket was already closed before. */

Source from the content-addressed store, hash-verified

70 * @retval <0 Most likely the socket was already closed before.
71 */
72int socket::destroy(void) {
73 if (0 > sfd) return 0;
74
75 if (0 > close(sfd)) return -1;
76
77 sfd = -1;
78
79 return 0;
80}
81
82/**
83 * @brief Returns the socket file descriptor.

Callers 7

mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected