コード例 #1
0
ファイル: Proxy.cs プロジェクト: HTD/Woof.Sockets
 /// <summary>
 /// Creates a new proxy between 2 targets.
 /// </summary>
 /// <param name="a">Point A.</param>
 /// <param name="b">Point B.</param>
 public Proxy(HostTarget a, HostTarget b)
 {
     A           = a;
     B           = b;
     ProxyServer = new ActiveEndPoint <T>(B);
     ProxyServer.SessionSpawned += ProxyServer_SessionSpawned;
 }
コード例 #2
0
ファイル: Router.cs プロジェクト: HTD/Woof.Sockets
 /// <summary>
 /// Creates a new end point router from common target to multiple remote targets.
 /// </summary>
 /// <param name="common">Common end.</param>
 /// <param name="targets">Remote targets.</param>
 public Router(HostTarget common, params HostTarget[] targets)
 {
     Common        = common;
     Targets       = targets;
     RoutingServer = new ActiveEndPoint <T>(Common)
     {
         Index = -1
     };
     RoutingServer.ExceptionThrown += AllTargets_ExceptionThrown;
     RoutingServer.SessionSpawned  += RoutingServer_SessionSpawned;
 }
コード例 #3
0
ファイル: ActiveEndPoint.cs プロジェクト: HTD/Woof.Sockets
 /// <summary>
 /// Creates client or server instance for specified host target.
 /// </summary>
 /// <param name="host">Host target.</param>
 /// <param name="protocolType">TCP (default), or UDP (not tested).</param>
 public ActiveEndPoint(HostTarget host, ProtocolType protocolType = ProtocolType.Tcp) => Host = host;