Hi Thomas,
tombert <
tomber...@live.at> wrote:
> I wrote an e-mail to Reinhard ... let's see if I got the correct
> address.
yes, you did. :)
> I have seen the disabled code in tclWinSock.c; Since it is Windows
> specific I did not care about.
Actually only the error handling and some types in that code are Windows
specific, so it wasn't hard to do a version for Unix based on the
Windows code. I can commit it to a branch, if you are interested.
> I did my implementation in tclIO.c. It seems to work for Linux and
> Windows.
That's not the right place, because TcpState and TcpFdList are private
structs of tclUnixSock.c and tclWinSock.c, so accessing them from the
generic code would breach the layering of the Tcl channel system. That's
why the channel system has
BTW, if you compare tclUnixSock.c and tclWinSock.c, you'll see that
there is lots of dupliacted logic in there that only differs in types,
error handling and event notification. If that stuff got factored out, I
think 80..90% of the now platform specific socket code could be merged
and moved to generic/tclIOSock.c . I always wanted to do that, but never
got around to make it happen...
BTW2, to simplify adding support for more socket options in the future,
I would prefer to have a single new switch to fconfigure ("-sockopt" or
some such) that takes a dictionary of option names and values.
cu
Reinhard