gethostbyname and getaddrinfo block. There is no way to stop them once they’ve started. (BTW, getaddrinfo is recommended over gethostbyname as it’s IPv6 compatible.) This little class will provide a neat way to get the info without blocking. Classes extra::Thread and extra::auto_HANDLE are thread and and auto handle closing classes respectivly (is that english?). When the [...]
Archive for July, 2007
gethostbyname or getaddrinfo that doesn’t block
Posted in Uncategorized on July 24, 2007 | Leave a Comment »
Dictionary, IEquatable, Equals and GetHashCode
Posted in .NET on July 19, 2007 | 1 Comment »
The docs for the .NET Dictionary class lead you to believe that implementing IEquatable for a dictionary key is good enough to get the dictionary to use your Equals method. However, one must also override GetHashCode. Given the way a dictionary works, this is logical but not documented. The interesting part, is that the Remove [...]
PMG Connect 2.0
Posted in PMG Connect on July 8, 2007 | Leave a Comment »
PMG Connect 2.0 Alpha (Build 124) - Proxy settings changes (autodetect and script handling).
Managed, Unmanaged and COM
Posted in .NET, C++, COM on July 6, 2007 | 2 Comments »
I’m wrapping a legacy lib for use in a .NET envirment.
Usefull: An Overview of Managed/Unmanaged Code Interoperability
Firstly, I tried to wrap the lib api with COM and use that from my C# app. With speed and efficiecency a priority, this was unacceptable. It involves callbacks (legacy lib) or events (COM) – the big slowdown happened in [...]