Describes the semantics of a WireBus connection. "Peer" refers to the other (non-local) connected party. The semantics of the local WireBus must match the peer WireBus, or messages will not be transmitted properly.
コード例 #1
0
        internal WireBusClient(Socket socket)
        {
            _socket    = socket;
            _semantics = new ConnectionSemantics();

            ReceiveMessages();
        }
コード例 #2
0
ファイル: WireBusClient.cs プロジェクト: bytenik/WireBus.NET
        internal WireBusClient(Socket socket)
        {
            _socket = socket;
            _semantics = new ConnectionSemantics();

            ReceiveMessages();
        }
コード例 #3
0
        internal WireBusClient(Socket socket, ConnectionSemantics semantics)
        {
            _socket    = socket;
            _semantics = semantics;

            ReceiveMessages();
        }
コード例 #4
0
ファイル: WireBusClient.cs プロジェクト: bytenik/WireBus.NET
		internal WireBusClient(Socket socket, ConnectionSemantics semantics)
		{
			_socket = socket;
		    _semantics = semantics;

		    ReceiveMessages();
		}
コード例 #5
0
 /// <summary>
 /// Creates a new host configured to listen on the specified IP and port
 /// </summary>
 /// <param name="address">local address</param>
 /// <param name="port">local port</param>
 /// <param name="semantics">the connection semantics</param>
 public WireBusListener(IPAddress address, int port, ConnectionSemantics semantics = new ConnectionSemantics())
 {
     _semantics = semantics;
     _listener  = new TcpListener(address, port);
 }
コード例 #6
0
 /// <summary>
 /// Creates a new host configured to listen on the specified IP and port
 /// </summary>
 /// <param name="endpoint">the local endpoint</param>
 /// <param name="semantics">the connection semantics</param>
 public WireBusListener(IPEndPoint endpoint, ConnectionSemantics semantics = new ConnectionSemantics())
 {
     _semantics = semantics;
     _listener  = new TcpListener(endpoint);
 }
コード例 #7
0
	    /// <summary>
		/// Creates a new host configured to listen on the specified IP and port
		/// </summary>
		/// <param name="address">local address</param>
		/// <param name="port">local port</param>
        /// <param name="semantics">the connection semantics</param>
        public WireBusListener(IPAddress address, int port, ConnectionSemantics semantics = new ConnectionSemantics())
	    {
	        _semantics = semantics;
	        _listener = new TcpListener(address, port);
	    }
コード例 #8
0
	    /// <summary>
	    /// Creates a new host configured to listen on the specified IP and port
	    /// </summary>
	    /// <param name="endpoint">the local endpoint</param>
	    /// <param name="semantics">the connection semantics</param>
	    public WireBusListener(IPEndPoint endpoint, ConnectionSemantics semantics = new ConnectionSemantics())
	    {
            _semantics = semantics;
            _listener = new TcpListener(endpoint);
        }
コード例 #9
0
ファイル: WireBusClient.cs プロジェクト: bytenik/WireBus.NET
		/// <summary>
		/// Connect to a peer, returning a new bus.
		/// </summary>
		/// <param name="host">the target host</param>
		/// <param name="port">the target port</param>
        /// <param name="semantics">the semantics of the connection</param>
        /// <returns>the bus wrapping the new connection</returns>
		public static WireBusClient Connect(IPAddress host, int port, ConnectionSemantics semantics = new ConnectionSemantics())
		{
			var bus = ConnectAsync(host, port);
			return bus.Result;
		}
コード例 #10
0
ファイル: WireBusClient.cs プロジェクト: bytenik/WireBus.NET
 /// <summary>
 /// Connect to a peer, returning a new bus.
 /// </summary>
 /// <param name="host">the target host</param>
 /// <param name="port">the target port</param>
 /// <param name="semantics">the semantics of the connection</param>
 /// <param name="timeout">the timeout after which to give up</param>
 /// <param name="token">token used to cancel connection attempt</param>
 /// <returns>the bus wrapping the new connection</returns>
 public static Task<WireBusClient> ConnectAsync(IPAddress host, int port, TimeSpan timeout, CancellationToken token, ConnectionSemantics semantics = new ConnectionSemantics())
 {
     var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
     return Task.Factory.FromAsync(socket.BeginConnect, socket.EndConnect, host, port, null)
         .ContinueWith(task => new WireBusClient(socket, semantics))
         .NaiveTimeoutAndCancellation(timeout, token);
 }
コード例 #11
0
ファイル: WireBusClient.cs プロジェクト: bytenik/WireBus.NET
 /// <summary>
 /// Connect to a peer, returning a new bus.
 /// </summary>
 /// <param name="host">the target host</param>
 /// <param name="port">the target port</param>
 /// <param name="semantics">the semantics of the connection</param>
 /// <param name="token">token used to cancel connection attempt</param>
 /// <returns>the bus wrapping the new connection</returns>
 public static Task<WireBusClient> ConnectAsync(IPAddress host, int port, CancellationToken token, ConnectionSemantics semantics = new ConnectionSemantics())
 {
     return ConnectAsync(host, port, TimeSpan.FromMilliseconds(-1), token, semantics);
 }
コード例 #12
0
ファイル: WireBusClient.cs プロジェクト: bytenik/WireBus.NET
 /// <summary>
 /// Connect to a peer, returning a new bus.
 /// </summary>
 /// <param name="host">the target host</param>
 /// <param name="port">the target port</param>
 /// <param name="semantics">the semantics of the connection</param>
 /// <param name="timeout">the timeout after which to give up</param>
 /// <returns>the bus wrapping the new connection</returns>
 public static Task<WireBusClient> ConnectAsync(IPAddress host, int port, TimeSpan timeout, ConnectionSemantics semantics = new ConnectionSemantics())
 {
     return ConnectAsync(host, port, timeout, CancellationToken.None, semantics);
 }
コード例 #13
0
ファイル: WireBusClient.cs プロジェクト: bytenik/WireBus.NET
	    /// <summary>
	    /// Connect to a peer, returning a new bus.
	    /// </summary>
	    /// <param name="host">the target host</param>
	    /// <param name="port">the target port</param>
	    /// <param name="millisecondsTimeout">the timeout in milliseconds after which to give up</param>
	    /// <param name="semantics">the semantics of the connection</param>
	    /// <returns>the bus wrapping the new connection</returns>
	    public static Task<WireBusClient> ConnectAsync(string host, int port, int millisecondsTimeout, ConnectionSemantics semantics = new ConnectionSemantics())
        {
            return ConnectAsync(host, port, TimeSpan.FromMilliseconds(millisecondsTimeout), semantics);
        }
コード例 #14
0
ファイル: WireBusClient.cs プロジェクト: bytenik/WireBus.NET
	    /// <summary>
	    /// Connect to a peer, returning a new bus.
	    /// </summary>
	    /// <param name="host">the target host</param>
	    /// <param name="port">the target port</param>
	    /// <param name="semantics">the semantics of the connection</param>
	    /// <returns>the bus wrapping the new connection</returns>
	    public static Task<WireBusClient> ConnectAsync(string host, int port, ConnectionSemantics semantics = new ConnectionSemantics())
	    {
	        return ConnectAsync(host, port, CancellationToken.None, semantics);
	    }