Example #1
0
        public TcpSocket(RedFoxEndpoint endpoint, TcpClient tcpClient)
        {
            if (tcpClient == null) throw new ArgumentNullException("tcpClient");
            TcpClient = tcpClient;
            _remoteEndPoint = tcpClient.Client.RemoteEndPoint;

            Endpoint = endpoint;
            Stream = tcpClient.GetStream();
        }
Example #2
0
        public StandardSocket(System.Net.Sockets.AddressFamily addressFamily,
		                       System.Net.Sockets.SocketType socketType,
		                       System.Net.Sockets.ProtocolType protocolType,
		                       System.Net.EndPoint localEndPoint)
        {
            if (localEndPoint == null)
                throw new ArgumentNullException ("localEndPoint");

            socket = new System.Net.Sockets.Socket (addressFamily, socketType, protocolType);
            this.localEndPoint = localEndPoint;
        }
Example #3
0
        public Socket(Reactor.Udp.Socket socket, System.Net.EndPoint endpoint)
        {
            this.OnConnect += ()    => { };

            this.OnData    += data  => { };

            this.OnError   += error => { };

            this.OnEnd     += ()    => { };

            this.sending    = false;

            this.socket     = socket;

            this.endpoint   = endpoint;
        }
Example #4
0
 public static System.Threading.Tasks.Task <int> SendToAsync(this System.Net.Sockets.Socket socket, System.ArraySegment <byte> buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEP)
 {
     throw null;
 }
Example #5
0
 public static System.Threading.Tasks.Task ConnectAsync(this System.Net.Sockets.Socket socket, System.Net.EndPoint remoteEP)
 {
     throw null;
 }
Example #6
0
 public void Listen(System.Net.EndPoint endPoint)
 {
 }
Example #7
0
 public NetworkDataEventArgs(byte[] data,System.Net.EndPoint endPoint)
 {
     this.Data = data;
     this.EndPoint = endPoint;
 }
 public FlowClientChannel(System.Net.EndPoint localEP)
 {
     _LocalEndPoint = localEP;
 }
Example #9
0
 void Utils.Wrappers.Interfaces.ISocket.Connect(System.Net.EndPoint remoteEP)
 {
     InternalSocket.Connect(remoteEP);
 }
Example #10
0
 public int SendTo(byte[] buffer, System.Net.EndPoint remoteEP)
 {
     throw null;
 }
		public RTMPOutputStream(
				PeerCast peercast,
				System.IO.Stream input_stream,
				System.IO.Stream output_stream,
				System.Net.EndPoint remote_endpoint,
				AccessControlInfo access_control,
				Guid channel_id,
				byte[] header)
		{
			input_stream.ReadTimeout = System.Threading.Timeout.Infinite;
			this.peerCast       = peercast;
      var stream = new ConnectionStream(new BufferedReadStream(input_stream, 8192, header), output_stream);
			this.inputStream    = stream;
			this.outputStream   = stream;
      stream.WriteTimeout = 10000;
			this.remoteEndPoint = remote_endpoint;
			this.accessControl  = access_control;
			this.connection = new RTMPPlayConnection(this, this.inputStream, this.outputStream);
		}
        public RTMPOutputStream(
				PeerCast peercast,
				System.IO.Stream input_stream,
				System.IO.Stream output_stream,
				System.Net.EndPoint remote_endpoint,
				AccessControlInfo access_control,
				Guid channel_id,
				byte[] header)
        {
            input_stream.ReadTimeout = System.Threading.Timeout.Infinite;
            this.peerCast       = peercast;
            this.inputStream    = new RateCountedStream(new BufferedReadStream(input_stream, 8192, header), TimeSpan.FromMilliseconds(1000));
            this.outputStream   = new RateCountedStream(output_stream, TimeSpan.FromMilliseconds(1000));
            this.remoteEndPoint = remote_endpoint;
            this.accessControl  = access_control;
            this.connection = new RTMPPlayConnection(this, this.inputStream, this.outputStream);
        }
Example #13
0
 public ProtocolEncoderOutputImpl(IoSession session, INextFilter nextFilter, IWriteRequest writeRequest)
 {
     _session = session;
     _nextFilter = nextFilter;
     _destination = writeRequest.Destination;
 }
Example #14
0
 /// <summary>
 /// Constructs a new observing endpoint.
 /// </summary>
 public ObservingEndpoint(System.Net.EndPoint ep)
 {
     _endpoint = ep;
 }
Example #15
0
        /// <inheritdoc/>
        public void Start()
        {
            if (System.Threading.Interlocked.CompareExchange(ref _running, 1, 0) > 0)
                return;

            if (_executor == null)
                Executor = Executors.Default;

            _localEP = _channel.LocalEndPoint;
            try
            {
                _matcher.Start();
                _channel.Start();
                _localEP = _channel.LocalEndPoint;
            }
            catch
            {
                if (log.IsWarnEnabled)
                    log.Warn("Cannot start endpoint at " + _localEP);
                Stop();
                throw;
            }
            if (log.IsDebugEnabled)
                log.Debug("Starting endpoint bound to " + _localEP);
        }
Example #16
0
 public void Connect(System.Net.EndPoint remoteEP)
 {
 }
Example #17
0
 public int ReceiveFrom(byte[] buffer, System.Net.Sockets.SocketFlags socketFlags, ref System.Net.EndPoint remoteEP)
 {
     throw null;
 }
Example #18
0
        public Socket(System.Net.IPAddress address, int port)
        {
            this.OnConnect += ()    => { };

            this.OnData    += data  => { };

            this.OnError   += error => { };

            this.OnEnd     += ()    => { };

            this.sending    = false;

            this.endpoint   = new System.Net.IPEndPoint(address, port);

            this.socket     = Reactor.Udp.Socket.Create();

            this.socket.Bind(System.Net.IPAddress.Any, 0);

            this.socket.OnMessage += (remote, data) => {

                if (remote.ToString() == this.endpoint.ToString()) {

                    this.Receive(data);
                }
            };

            var syn = new Syn(Random.Get());

            this.socket.Send(this.endpoint, syn.Serialize());
        }
Example #19
0
 System.IAsyncResult Utils.Wrappers.Interfaces.ISocket.BeginSendTo(byte[] buffer, int offset, int size, SocketFlags socketFlags, System.Net.EndPoint remoteEP, System.AsyncCallback callback, object state)
 {
     return(InternalSocket.BeginSendTo(buffer, offset, size, socketFlags, remoteEP, callback, state));
 }
 /// <summary>
 /// </summary>
 public DataReceivedEventArgs(Byte[] data, System.Net.EndPoint endPoint)
 {
     _data = data;
     _endPoint = endPoint;
 }
Example #21
0
 int Utils.Wrappers.Interfaces.ISocket.EndReceiveMessageFrom(System.IAsyncResult asyncResult, ref SocketFlags socketFlags, ref System.Net.EndPoint endPoint, out System.Net.Sockets.IPPacketInformation ipPacketInformation)
 {
     return(InternalSocket.EndReceiveMessageFrom(asyncResult, ref socketFlags, ref endPoint, out ipPacketInformation));
 }
Example #22
0
        public bool ConnectToServer()
        {
            bool result = false;
            //now register to server
            foreach (SecurityResource item in _SecurityResources.Children)
            {
                Console.Write(item.ServerURI);
                Console.Write(") .. ");
                Uri uri = new Uri(item.ServerURI);
                foreach (System.Net.IPAddress address in System.Net.Dns.GetHostAddresses(uri.DnsSafeHost))
                {
                    bool secure =false;
                    int port = 5683;
                    if (string.Compare(uri.Scheme, "coaps", true) == 0)
                    {
                        secure = true;
                        port = 5684;
                    }
                    if (uri.Port > 0)
                        port = uri.Port;
                    if (_Channel.Secure != secure)
                    {
                        _Channel.Stop();
                        _Channel.Secure = secure;
                        _Channel.Start();
                    }
                    CoapClient coapClient = new CoapClient();
                    coapClient.EndPoint = _EndPoint;
                    Request request = new Request(Method.POST);
                    request.Destination = new System.Net.IPEndPoint(address, port);
                    request.UriPath = "/rd";
                    request.UriQuery = string.Concat("ep=test",Environment.MachineName,"&lt=35");
                    StringBuilder payLoad = new StringBuilder();
                    foreach (IResource objectType in _Root.Children)
                    {
                        if (objectType.Visible)
                        {
                            bool instances = false;
                            foreach (IResource instance in objectType.Children)
                            {
                                if (payLoad.Length > 0)
                                    payLoad.Append(',');
                                payLoad.Append('<');
                                payLoad.Append('/');
                                payLoad.Append(objectType.Name);
                                payLoad.Append('/');
                                payLoad.Append(instance.Name);
                                payLoad.Append('>');
                                instances = true;
                            }
                            if (!instances)
                            {
                                if (payLoad.Length > 0)
                                    payLoad.Append(',');
                                payLoad.Append('<');
                                payLoad.Append('/');
                                payLoad.Append(objectType.Name);
                                payLoad.Append('>');
                            }
                        }
                    }
                    request.PayloadString = payLoad.ToString();
                    request.ContentType = (int)MediaType.ApplicationLinkFormat;
                    Response response = coapClient.Send(request);
                    if (response != null && response.StatusCode == StatusCode.Created)
                    {
                        string location = response.LocationPath;

                        int position = location.LastIndexOf('/');
                        if (position > 0)
                        {
                            ClientID = location.Substring(position + 1);
                        }

                        result = true;
                        _ServerEndPoint = request.Destination;
                        _Location = location;
                        _Timer.Start();
                        break;
                    }
                }
            }
            return result;
        }
 public System.Threading.Tasks.ValueTask <Microsoft.AspNetCore.Connections.IConnectionListener> BindAsync(System.Net.EndPoint endpoint, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     throw null;
 }
 public int ReceiveFrom(byte[] buffer, System.Net.Sockets.SocketFlags socketFlags, ref System.Net.EndPoint remoteEP)
 {
     return(default(int));
 }
Example #25
0
 public EndPointEventArgs(System.Net.EndPoint value)
 {
     this.Value = value;
 }
 public int ReceiveMessageFrom(byte[] buffer, int offset, int size, ref System.Net.Sockets.SocketFlags socketFlags, ref System.Net.EndPoint remoteEP, out System.Net.Sockets.IPPacketInformation ipPacketInformation)
 {
     ipPacketInformation = default(System.Net.Sockets.IPPacketInformation); return(default(int));
 }
Example #27
0
 public void Listen(System.Net.EndPoint endPoint, System.Action <Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions> configure)
 {
 }
 public int SendTo(byte[] buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEP)
 {
     return(default(int));
 }
Example #29
0
 public static System.Threading.Tasks.Task <System.Net.Sockets.SocketReceiveMessageFromResult> ReceiveMessageFromAsync(this System.Net.Sockets.Socket socket, System.ArraySegment <byte> buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEndPoint)
 {
     throw null;
 }
 public static System.Threading.Tasks.Task ConnectAsync(this System.Net.Sockets.Socket socket, System.Net.EndPoint remoteEP)
 {
     return(default(System.Threading.Tasks.Task));
 }
Example #31
0
 public void Bind(System.Net.EndPoint localEP)
 {
 }
 public static System.Threading.Tasks.Task <System.Net.Sockets.SocketReceiveFromResult> ReceiveFromAsync(this System.Net.Sockets.Socket socket, System.ArraySegment <byte> buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEndPoint)
 {
     return(default(System.Threading.Tasks.Task <System.Net.Sockets.SocketReceiveFromResult>));
 }
Example #33
0
 public int ReceiveFrom(byte[] buffer, ref System.Net.EndPoint remoteEP)
 {
     throw null;
 }
 public static System.Threading.Tasks.Task <int> SendToAsync(this System.Net.Sockets.Socket socket, System.ArraySegment <byte> buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEP)
 {
     return(default(System.Threading.Tasks.Task <int>));
 }
Example #35
0
 public int ReceiveMessageFrom(byte[] buffer, int offset, int size, ref System.Net.Sockets.SocketFlags socketFlags, ref System.Net.EndPoint remoteEP, out System.Net.Sockets.IPPacketInformation ipPacketInformation)
 {
     throw null;
 }
Example #36
0
 public FlowClientChannel(System.Net.EndPoint localEP)
 {
     _LocalEndPoint = localEP;
 }
Example #37
0
 public int SendTo(byte[] buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEP)
 {
     throw null;
 }
 public QuicConnection(System.Net.EndPoint remoteEndPoint, System.Net.Security.SslClientAuthenticationOptions?sslClientAuthenticationOptions, System.Net.IPEndPoint?localEndPoint = null)
 {
 }
Example #39
0
 void Utils.Wrappers.Interfaces.ISocket.Bind(System.Net.EndPoint localEP)
 {
     InternalSocket.Bind(localEP);
 }
 public QuicConnection(System.Net.Quic.Implementations.QuicImplementationProvider implementationProvider, System.Net.EndPoint remoteEndPoint, System.Net.Security.SslClientAuthenticationOptions?sslClientAuthenticationOptions, System.Net.IPEndPoint?localEndPoint = null)
 {
 }
Example #41
0
 int Utils.Wrappers.Interfaces.ISocket.EndReceiveFrom(System.IAsyncResult asyncResult, ref System.Net.EndPoint endPoint)
 {
     return(InternalSocket.EndReceiveFrom(asyncResult, ref endPoint));
 }
 public static int EndReceiveFrom(this System.Net.Sockets.Socket socket
                                  , IAsyncResult asyncResult, ref System.Net.EndPoint endPoint)
 {
     return(((Task <int>)asyncResult).Result);
 }
Example #43
0
 int Utils.Wrappers.Interfaces.ISocket.ReceiveFrom(byte[] buffer, SocketFlags socketFlags, ref System.Net.EndPoint remoteEP)
 {
     return(InternalSocket.ReceiveFrom(buffer, socketFlags, ref remoteEP));
 }
                static TestFramework()
                {
                    _rtspServer = new System.Net.IPEndPoint(System.Net.IPAddress.Loopback, 10554);

                    //  Create a (single) listening socket.
                    _listenSocket = new System.Net.Sockets.Socket(_rtspServer.AddressFamily, System.Net.Sockets.SocketType.Stream, System.Net.Sockets.ProtocolType.Tcp);
                    _listenSocket.Bind(_rtspServer);
                    _listenSocket.Listen(1);
                }