"sockaddr",
"struct sockaddr for this address",
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-#ifdef G_OS_WIN32
- /* This hopefully is a good place to call WSAStartup */
- {
- WSADATA wsadata;
- if (WSAStartup (MAKEWORD (2, 0), &wsadata) != 0)
- g_error ("Windows Sockets could not be initialized");
- }
-#endif
}
static GObject *
* soup_socket_get_remote_address()) may be useful to applications.
**/
-G_DEFINE_TYPE (SoupSocket, soup_socket, G_TYPE_OBJECT)
+static void
+_soup_networking_init (void)
+{
+#ifdef G_OS_WIN32
+ WSADATA wsadata;
+ if (WSAStartup (MAKEWORD (2, 0), &wsadata) != 0)
+ g_error ("Windows Sockets could not be initialized");
+#endif
+}
+
+G_DEFINE_TYPE_WITH_CODE (SoupSocket, soup_socket, G_TYPE_OBJECT,
+ _soup_networking_init ();)
enum {
READABLE,
"Value in seconds to timeout a blocking I/O",
0, G_MAXUINT, 0,
G_PARAM_READWRITE));
-
-#ifdef G_OS_WIN32
- /* Make sure WSAStartup() gets called. */
- soup_address_get_type ();
-#endif
}
g_type_init ();
/* On Windows, this will call WSAStartup() */
- soup_address_get_type ();
+ soup_socket_get_type ();
while ((opt = getopt (argc, argv, "c:d:k:")) != -1) {
switch (opt) {