Ejemplo n.º 1
0
        public static bool TryCreateTransport(Socket socket,string protocol, out BaseTransport transport)
        {
            if (protocol == "tcp")
            {
                transport = new TcpTransport(socket.Options);
                return true;
            }

            transport = null;
            return false;
        }
Ejemplo n.º 2
0
        private bool TryGetTransport(string protocol, out BaseTransport transport)
        {
            if (m_transports.TryGetValue(protocol, out transport))
                return true;
            else if (TransportManager.TryCreateTransport(this, protocol, out transport))
            {
                m_transports.Add(protocol, transport);
                LaunchChild(transport);
                return true;
            }

            return false;
        }