Re: Listening to Windows Socket events
- From: Alexandre Ferrieux <alexandre.ferrieux@xxxxxxxxx>
- Date: Mon, 17 Nov 2008 09:43:42 -0800 (PST)
On Nov 17, 6:39 pm, David Gravereaux <davyg...@xxxxxxxxx> wrote:
My question is:
How to ask tcl event loop that I want it to notify me when the OS
(Windows) sends the message WM_USER ?
It might be easier to use WSAEventSelect for your core by not needing an
hwnd, or even discard it completely in favor of Tcl's socket API and
call it directly from C.
chan = Tcl_OpenTcpClient(interp, 1024, "example.com", "", 0, 1);
Tcl_SetChannelOption(interp, chan, "-translation", "line");
Tcl_CreateChannelHandler(chan, TCL_READABLE, readProc, NULL);
Going that route, you might consider leaving all the IO and eventloop
to the script level and limiting the C-Tcl interaction to atomic data