Ejemplo n.º 1
0
            private void PersistentChatBeginEstablishFinished(IAsyncResult ar)
            {
                currentOperation.End("PersistentChatBeginEstablishFinished", () => persistentChatEndpoint.EndEstablish(ar));

                // Persistent Chat Client actually requests 11 different bundles of preferences
                currentOperation.Begin("Get Client Preferences", () => persistentChatEndpoint.PersistentChatServices.
                                       BeginGetPreferenceBundle("PrefLabel", -1,
                                                                false,
                                                                BeginGetPreferenceBundleFinished,
                                                                null));
            }
        public static PersistentChatEndpoint ConnectPersistentChatServer(UserEndpoint userEndpoint, Uri persistentChatServerUri)
        {
            Console.WriteLine("{0} Connecting to Persistent Chat Server...", userEndpoint.EndpointUri);

            PersistentChatEndpoint persistentChatEndpoint = new PersistentChatEndpoint(persistentChatServerUri, userEndpoint);

            persistentChatEndpoint.EndEstablish(persistentChatEndpoint.BeginEstablish(null, null));
            Console.WriteLine("\t{0}-ConnectPersistentChatServer >>>>Successing" + userEndpoint.EndpointUri);

            DisplayServerInfo(persistentChatEndpoint.PersistentChatServices.ServerConfiguration);

            return(persistentChatEndpoint);
        }