public void DeclineConnection(TwoWayRemotingConnectionEventArgs connectionArgs, string reason)
        {
            if (connectionArgs != null && connectionArgs.ClientObject != null)
            {
                ConnectionRequestResultEventArgs cr = new ConnectionRequestResultEventArgs(false, reason);

                InternalCallClientMethodAsync(connectionArgs.ClientObject, connectionArgs.ClientUri, "OnConnectionDenied", false, cr);
            }
        }
        public void OnConnectionAccepted(ConnectionRequestResultEventArgs e)
        {
            connected = true;

            // Start our keep alive timer
            if (keepAliveInterval > 0)
            {
                keepAliveTimer = new System.Threading.Timer(new System.Threading.TimerCallback(KeepAliveTimerProc), this, keepAliveInterval, keepAliveInterval);
            }

            WOSI.Utilities.EventUtils.FireAsyncEvent(ConnectionAccepted, this, e);
        }
        public void AcceptConnection(TwoWayRemotingConnectionEventArgs connectionArgs)
        {
            if (connectionArgs != null && connectionArgs.ClientObject != null)
            {
                ConnectionRequestResultEventArgs cr = new ConnectionRequestResultEventArgs(true, null);

                InternalCallClientMethodAsync(connectionArgs.ClientObject, connectionArgs.ClientUri, "OnConnectionAccepted", false, cr);

                TwoWayRemotingClientConnectionInfo ci = new TwoWayRemotingClientConnectionInfo(connectionArgs.ClientObject, connectionArgs.SessionKey);
                lock (connectedClients)
                {
                    connectedClients.Add(ci.RemoteUri, ci);
                }

                if (ClientConnected != null)
                {
                    ClientConnected(this, connectionArgs);
                }
            }
        }
        public void OnConnectionDenied(ConnectionRequestResultEventArgs e)
        {
            connected = false;

            WOSI.Utilities.EventUtils.FireAsyncEvent(ConnectionDenied, this, e);
        }