提交 840feace 编写于 作者: R Rolf Bjarne Kvinge

The System.Net.Sockets.Socket type lives in both System.dll and System.Net.dll for moonlight

上级 148ff89e
......@@ -212,32 +212,38 @@ enum {
AIO_OP_LAST
};
static MonoImage *
get_socket_assembly (void)
/*
* Note that we call it is_socket_type() where 'socket' refers to the image
* that contains the System.Net.Sockets.Socket type.
* For moonlight there is a System.Net.Sockets.Socket class in both System.dll and System.Net.dll.
*/
static gboolean
is_socket_type (MonoClass *klass)
{
static const char *version = NULL;
static gboolean moonlight;
static MonoImage *socket_assembly = NULL;
static MonoImage *system_dll = NULL;
static MonoImage *system_net_dll = NULL;
if (system_dll == NULL)
system_dll = mono_image_loaded ("System");
if (klass->image == system_dll)
return TRUE;
/* If moonlight, check if the type is in System.Net.dll too */
if (version == NULL) {
version = mono_get_runtime_info ()->framework_version;
moonlight = !strcmp (version, "2.1");
}
if (socket_assembly == NULL)
socket_assembly = mono_image_loaded (moonlight ? "System.Net" : "System");
return socket_assembly;
}
if (!moonlight)
return FALSE;
/*
* Note that we call it is_socket_type() where 'socket' refers to the image
* that contains the System.Net.Sockets.Socket type.
*/
static gboolean
is_socket_type (MonoClass *klass)
{
return klass->image == get_socket_assembly ();
if (system_net_dll == NULL)
system_net_dll = mono_image_loaded ("System.Net");
return klass->image == system_net_dll;
}
static gboolean
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册