Function netio_close_socket

Function Documentation

void netio_close_socket(struct netio_eventloop *evloop, void *socket, enum socket_type type)

Closes a socket.

netio_close_socket will deallocate the resources associated to a socket and close the corresponding file descriptor. The type of socket is specified by the third argument. The socket is not freed as the function ignores whether it had been allocated statically or dynamically.

Parameters:
  • evloop – The event loop to which the socket belongs

  • socket – Pointer to the socket

  • type – Type of socket as defined by enum socket_type.