// Handle input on the server socket by accepting the connection
        // and reading the rpc request. Return true to continue to monitor
        // the socket for events, false to remove it from the dispatcher.
        public override XmlRpcDispatch.EventType HandleEvent(XmlRpcDispatch.EventType eventType)
        {
            if (_connectionState == ServerConnectionState.READ_HEADER)
            {
                if (!readHeader(ref header))
                {
                    return(0);
                }
            }
            if (_connectionState == ServerConnectionState.READ_REQUEST)
            {
                if (!readRequest())
                {
                    return(0);
                }
            }

            if (_connectionState == ServerConnectionState.WRITE_RESPONSE)
            {
                if (!writeResponse(header.DataString))
                {
                    return(0);
                }
            }

            return((_connectionState == ServerConnectionState.WRITE_RESPONSE)
                ? XmlRpcDispatch.EventType.WritableEvent : XmlRpcDispatch.EventType.ReadableEvent);
        }
예제 #2
0
        // Possible IO states for the connection
        // XmlRpcSource interface implementation
        // Handle server responses. Called by the event dispatcher during execute.
        public override XmlRpcDispatch.EventType HandleEvent(XmlRpcDispatch.EventType eventType)
        {
            if (eventType == XmlRpcDispatch.EventType.Exception)
            {
                if (_connectionState == ConnectionState.WRITE_REQUEST && _bytesWritten == 0)
                {
                    XmlRpcUtil.error("Error in XmlRpcClient::handleEvent: could not connect to server ({0}).",
                                     getSocketError());
                }
                else
                {
                    XmlRpcUtil.error("Error in XmlRpcClient::handleEvent (state {0}): {1}.",
                                     _connectionState, getSocketError());
                }
                return(0);
            }

            if (_connectionState == ConnectionState.WRITE_REQUEST)
            {
                if (!writeRequest())
                {
                    return(0);
                }
            }

            if (_connectionState == ConnectionState.READ_HEADER)
            {
                if (!readHeader(ref header))
                {
                    return(0);
                }
            }

            if (_connectionState == ConnectionState.READ_RESPONSE)
            {
                if (!readResponse())
                {
                    return(0);
                }
            }

            // This should probably always ask for Exception events too
            return((_connectionState == ConnectionState.WRITE_REQUEST)
                ? XmlRpcDispatch.EventType.WritableEvent : XmlRpcDispatch.EventType.ReadableEvent);
        }
예제 #3
0
 // Handle input on the server socket by accepting the connection
 // and reading the rpc request.
 public override XmlRpcDispatch.EventType HandleEvent(XmlRpcDispatch.EventType eventType)
 {
     AcceptConnection();
     return(XmlRpcDispatch.EventType.ReadableEvent);  // Continue to monitor this fd
 }
예제 #4
0
 public virtual XmlRpcDispatch.EventType HandleEvent(XmlRpcDispatch.EventType eventType)
 {
     throw new NotImplementedException();
 }
예제 #5
0
 public abstract XmlRpcDispatch.EventType HandleEvent(XmlRpcDispatch.EventType eventType);