Inheritance: MessageHandler
コード例 #1
0
ファイル: Faye.cs プロジェクト: Connorcpu/XamarinFayeClient
        public static MessageHandler Connect(Uri uri)
        {
            MessageHandler handler;
            switch (uri.Scheme) {
                case "http":
                case "https":
                    handler = new PollingHandler();
                    break;
                case "ws":
                case "wss":
                    handler = new WebsocketHandler();
                    break;
                default: throw new ArgumentException("Uri scheme '" + uri.Scheme + "' was not recognized.");
            }

            handler.connectionUri = uri.ToString();
            return handler;
        }
コード例 #2
0
        public static MessageHandler Connect(Uri uri)
        {
            MessageHandler handler;

            switch (uri.Scheme)
            {
            case "http":
            case "https":
                handler = new PollingHandler();
                break;

            case "ws":
            case "wss":
                handler = new WebsocketHandler();
                break;

            default: throw new ArgumentException("Uri scheme '" + uri.Scheme + "' was not recognized.");
            }

            handler.connectionUri = uri.ToString();
            return(handler);
        }