Socket support rewritten. It was utterly broken, and untested in fact. We
authorTor Lillqvist <tml@iki.fi>
Thu, 25 Jan 2001 21:16:46 +0000 (21:16 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Thu, 25 Jan 2001 21:16:46 +0000 (21:16 +0000)
commit8a0df0a71c88c04d4fccbc6780b7105bc527261b
tree1bb721197f1cb02c8e3d1475352f2ea24c2689fb
parent9f9ad3603193c9154d0b5caebae4ead4d3c4d368
Socket support rewritten. It was utterly broken, and untested in fact. We

2001-01-25  Tor Lillqvist  <tml@iki.fi>

* giowin32.c: Socket support rewritten. It was utterly broken, and
untested in fact. We still do use a thread for each socket being
watched, but instead of blocking in recv() (which of course was
plain stupid for sockets being liste()ed on), we block in
select(). The read method for sockets calls recv(). It is now
possible for the application to call accept(), recv() or send() in
the callback, just like on Unix. Tested with code kindly provided
by Andrew Lanoix.

Rename g_io_channel_win32_new_stream_socket() to
g_io_channel_win32_new_socket() as it isn't restricted to stream
sockets.

* gmain.c (g_poll): Related changes in the Win32 version of
g_poll(). When polling for messages, always do a PeekMessage()
first. We used to miss messages if several were posted between
calls to g_poll().

* giochannel.h: Improve Win32-related comments.

* gutf8.c: (Win32) Include <stdio.h> for sprintf.

* tests/gio-test.c: (Win32) Add tests for polling for Windows
messages.

* tests/makefile.mingw.in: Remove superfluous compilation command
line.
20 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
giochannel.h
giowin32.c
glib.def
glib/giochannel.h
glib/giowin32.c
glib/glib.def
glib/gmain.c
glib/gutf8.c
gmain.c
gutf8.c
tests/gio-test.c
tests/makefile.mingw.in