If you apply to an Internet Enterprise Architect distributed solutions are part of the question because the popular SOA is not nonsense about SOA. Online resources A lot of attention 4 words "based on message"
This article only evaluates the several commonly used in the project
Remoting (TCP,HTTP,IPC)
WCF (basichttpbinding,nettcpbinding)
Hessian
Msmq
WebService
......
Environment Introduction
Client Windows Xp server windows2003 (virtual machine)
Bandwidth 2M
test environment and online environment gap is larger we can see the relativity.
All scenarios are based on the same remote object
public class Dtoclass:marshalbyrefobject
{public
static message Getmessageinfo (string param1, int param2, BOOL PARAM3)
{
var dto = new Message {Param1 = param1, Param2 = param2, Param3 = param3};
return dto;
}
}
[Serializable]
public class message
{public
string Param1 {get; set;}
public int Param2 {get; set;}
public bool Param3 {get; set;}
}
Public interface imaoyatest
{message
getdto (string param1, int param2, bool param3);
[ServiceContract]
Public interface iwcfmaoyatest
{
[operationcontract] Message
getdto (string param1, int param2, BOOL PARAM3);
}
Different communication scheme clients request the same object
such as remoting
Public message Tcpsinglecall ()
{
var proxy = (imaoyatest) Activator.GetObject (typeof (Imaoyatest), tcp:// 192.168.234.129:8001/maoyatesturl ");
Return proxy. Getdto ("Chongzi", True);
}
Hsssian
Public message hessiantest ()
{
var factory = new Chessianproxyfactory ("UserName", "password");
Const string URL = "Http://192.168.234.129/HessianService.hessian";
var hessianinstance = (imaoyatest) factory. Create (typeof (Imaoyatest), url);
Return hessianinstance. Getdto ("Chongzi", True);
}
Different communication schemes for different processing of remote objects
such as remoting
public class Remotingtest:marshalbyrefobject,imaoyatest
{public message
getdto (string param1, int param2, BOOL param3)
{return
dtoclass.getmessageinfo ("Remoting:" +PARAM1,PARAM2+1,PARAM3);
}
Hsssian
public class Maoyaservice:chessianhandler, imaoyatest
{public message
getdto (string param1, int param2, BOOL PA RAM3)
{return
dtoclass.getmessageinfo ("Hessianservice:" + param1, param2 + 3, param3);
}
This article URL address: http://www.bianceng.cn/Programming/csharp/201410/45482.htm