Add g_socket_close
[cascardo/gnio.git] / gnio / gsocket.c
index 9f9a5ac..0887202 100644 (file)
@@ -454,3 +454,15 @@ g_socket_send (GSocket       *socket,
 
   return ret;
 }
+
+void
+g_socket_close (GSocket *socket)
+{
+  g_return_if_fail (G_IS_SOCKET (socket));
+
+#ifdef G_OS_WIN32
+  closesocket (socket->priv->fd);
+#else
+  close (socket->priv->fd);
+#endif
+}