Using a Gio.SocketClient
one can connect asynchronously to a server using connectAsync
. This requires supplying a function with the signature extern(C) void connectionCallback(GObject* object, GAsyncResult* result, void * userData)
. This function is supposed to call connectFinish
to complete the data collection. In C this is easy as the parameter to connectFinish
is a GAsyncResult*
, exactly the result parameter to connectCallback
. However the signature in D requires the parameter be an AsyncResultIF
. So the question is how does one create an instance of an AsyncResultIF
from a GAsyncResult*
in D. The subsidiary question is why does this have to be done in D when it is not needed in C?