Ejemplo n.º 1
0
        private SocketArgs Connect(Socket Socket, Peer Peer, bool isSecure, bool isLocal)
        {
            SocketInterface sI = Sockets.Create(Socket, Peer, isSecure, isLocal);

            sI.Init();

            return(new SocketArgs(sI));
        }
Ejemplo n.º 2
0
        public Proxy(int Port, bool isSecure, bool isLocal)
        {
            Server = new Sockets <Connection>(Port, isSecure, isLocal);

            Server.Closed       += Closed;
            Server.Received     += Process;
            Server.WriteLine    += Status;
            Server.Connection   += Connected;
            Server.Disconnected += Server_Disconnected;
        }
Ejemplo n.º 3
0
        public void Close(string Reason)
        {
            if (isClosed)
            {
                return;
            }

            isClosed = true;

            if (Server != null)
            {
                Server.Close(Reason);
                Server = null;
            }
        }
Ejemplo n.º 4
0
        public void Connect(string Host, int Port, int Ms, bool isSecure)
        {
            var xx = this;

            Sockets.Connect((Peer)xx, Host, Port, Ms, isSecure, Local, Completed);
        }
Ejemplo n.º 5
0
 public void Connect(Socket Socket, Peer Peer, bool isSecure, bool isLocal)
 {
     Start(Sockets.Create(Socket, Peer, isSecure, isLocal));
 }