本文整理汇总了C#中Edge.Subscribe方法的典型用法代码示例。如果您正苦于以下问题:C# Edge.Subscribe方法的具体用法?C# Edge.Subscribe怎么用?C# Edge.Subscribe使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Edge
的用法示例。
在下文中一共展示了Edge.Subscribe方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ETClient
public ETClient(Edge e)
{
_sync = new object();
_sent_blocks = new Hashtable();
_e = e;
_e.Subscribe(this, null );
}
示例2: WrapperEdge
///<summary>Creates a new WrapperEdge.<summary>
///<param name="edge">The edge to wrap.</param>
///<param name="SubscribeToEdge">Should this subscribe to the edge.</param>
public WrapperEdge(Edge edge, bool SubscribeToEdge) {
_weclosed = 0;
_edge = edge;
if(SubscribeToEdge) {
_edge.Subscribe(this, null);
}
}
示例3: WrapEdge
///<summary>Makes the SecurityOverlord listen to the edge and instantiates
///a new SecurityAssociation for the insecure edge. CreateSecurityAssociation
///is idempotent.</summary>
protected override void WrapEdge(Edge edge) {
edge.Subscribe(_so, null);
SecurityAssociation sa = _so.CreateSecurityAssociation(edge, DefaultEdgeSPI, !edge.IsInbound);
if(edge.IsClosed) {
sa.Close("Edge closed too quickly.");
}
}
示例4: WrapEdge
///<summary>Makes the SecurityOverlord listen to the edge and instantiates
///a new SecurityAssociation for the insecure edge. CreateSecurityAssociation
///is idempotent.</summary>
protected override void WrapEdge(Edge edge) {
edge.Subscribe(_so, null);
if(edge.IsInbound) {
lock(_sync) {
_edge_to_inbound.Add(edge, true);
}
} else {
SecurityAssociation sa = _so.CreateSecurityAssociation(edge);
lock(_sync) {
_edge_to_sa.Add(edge, sa);
}
}
try {
edge.CloseEvent += HandleEdgeClose;
} catch {
HandleEdgeClose(edge, EventArgs.Empty);
}
}
示例5: ETServer
public ETServer(Edge e) {
e.Subscribe(this, null);
_e = e;
}
示例6: HandleEC
public void HandleEC(bool succ, Edge e, Exception x) {
if( succ ) {
/*
* Got the underlying Edge, now do the path protocol
*/
Channel results = new Channel(1);
results.CloseEvent += delegate(object q, EventArgs args) {
try {
RpcResult res = (RpcResult)results.Dequeue();
object o = res.Result;
if(o is Exception) {
Console.WriteLine(o);
throw (o as Exception);
}
//If we get here, everything looks good:
PathEdge pe = new PathEdge(e, LocalPath, RemotePath);
//Start sending e's packets into pe
pe.Subscribe();
ECB(true, pe, null);
}
catch(Exception cx) {
ECB(false, null, cx);
}
};
//Make sure we hear the packets on this edge:
e.Subscribe(_pel._pem, null);
//Now make the rpc call:
_pel._pem.Rpc.Invoke(e, results, "sys:pathing.create", LocalPath, RemotePath );
}
else {
ECB(false, null, x);
}
}