示例#1
0
/*
 * 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 (MonoDomain *domain, MonoClass *klass)
{
	static const char *version = NULL;
	static gboolean moonlight;

	if (is_system_type (domain, klass))
		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 (!moonlight)
		return FALSE;

	if (domain->system_net_dll == NULL)
		domain->system_net_dll = mono_image_loaded ("System.Net");
	
	return klass->image == domain->system_net_dll;
}
示例#2
0
/*
 * 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 (MonoDomain *domain, MonoClass *klass)
{
	return is_system_type (domain, klass);
}