欢迎光临
我们一直在努力

RealProxy的PrivateInvoke方法在构造调用时的执行代码-.NET教程,Asp.Net开发

建站超值云服务器,限时71元/月

private void privateinvoke(ref messagedata msgdata, int type)
{
imessage message1 = null;
calltype type1 = (calltype) type;
imessage message2 = null;
int num1 = -1;
remotingproxy proxy1 = null;
////////////////////////
num1 = 0;
proxy1 = this as remotingproxy;
constructorcallmessage message4 = null;
bool flag1 = false;
if (!this.isremotingproxy())
{
message4 = new constructorcallmessage(null, null, null, this.getproxiedtype());
}
else
{
message4 = proxy1.constructormessage;
identity identity1 = proxy1.identityobject;
if (identity1 != null)
{
flag1 = identity1.iswellknown();
}
}
if ((message4 == null) || flag1)
{
message4 = new constructorcallmessage(null, null, null, this.getproxiedtype());
message4.setframe(msgdata);
message1 = message4;
if (flag1)
{
proxy1.constructormessage = null;
if (message4.argcount != 0)
{
throw new remotingexception(environment.getresourcestring("remoting_activation_wellknownctor"));
}
}
message2 = new constructorreturnmessage((marshalbyrefobject) this.gettransparentproxy(), null, 0, null, message4);
}
else
{
message4.setframe(msgdata);
message1 = message4;
}
////////////////////////
channelservices.incrementremotecalls();

if (message2 == null)
{
logicalcallcontext context1 = null;
thread thread1 = thread.currentthread;
context1 = thread1.getlogicalcallcontext();
this.setcallcontextinmessage(message1, num1, context1);
context1.propagateoutgoingheaderstomessage(message1);
message2 = this.invoke(message1);
this.returncallcontexttothread(thread1, message2, num1, context1);
callcontext.getlogicalcallcontext().propagateincomingheaderstocallcontext(message2);
}
realproxy.handlereturnmessage(message1, message2);
////////////////////////
marshalbyrefobject obj1 = null;
iconstructionreturnmessage message7 = message2 as iconstructionreturnmessage;
if (message7 == null)
{
throw new remotingexception(environment.getresourcestring("remoting_proxy_badreturntypeforactivation"));
}
constructorreturnmessage message8 = message7 as constructorreturnmessage;
if (message8 != null)
{
obj1 = (marshalbyrefobject) message8.getobject();
if (obj1 == null)
{
throw new remotingexception(environment.getresourcestring("remoting_activation_nullreturnvalue"));
}
}
else
{
obj1 = (marshalbyrefobject) remotingservices.internalunmarshal((objref) message7.returnvalue, this.gettransparentproxy(), true);
if (obj1 == null)
{
throw new remotingexception(environment.getresourcestring("remoting_activation_nullfrominternalunmarshal"));
}
}
if (obj1 != ((marshalbyrefobject) this.gettransparentproxy()))
{
throw new remotingexception(environment.getresourcestring("remoting_activation_inconsistentstate"));
}
if (this.isremotingproxy())
{
proxy1.constructormessage = null;
}
////////////////////////
}

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » RealProxy的PrivateInvoke方法在构造调用时的执行代码-.NET教程,Asp.Net开发
分享到: 更多 (0)