Thread + socket = (shared) problem? (2.048)
Masahiro Nakagawa
repeatedly at gmail.com
Tue Sep 7 07:22:43 PDT 2010
On Tue, 07 Sep 2010 18:48:22 +0900, Bane
<branimir.milosavljevic at gmail.com> wrote:
>> Please show your environment. Windows?
>
> WinXP sp2, phenom quad core.
Current std.socket uses "static ~this" for WSACleanup.
In this case, main thread calls "static ~this" before MyThread executes
"new TcpSocket".
std.socket workarounds:
1. static ~this -> shared static ~this
Main thread calls WSAStartup and WSACleanup.
2. Create reference count
sample code - http://ideone.com/vRMO0
3. other?
I don't know the best way.
More information about the Digitalmars-d
mailing list