public override void addToDispatch(XmlRpcDispatch disp) { if (disp == null) return; if (check()) return; disp.AddSource(client, (XmlRpcDispatch.EventType.WritableEvent | XmlRpcDispatch.EventType.Exception)); }
// 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; }
// 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; }
public virtual XmlRpcDispatch.EventType HandleEvent(XmlRpcDispatch.EventType eventType) { throw new NotImplementedException(); }
// 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 }
public override void removeFromDispatch(XmlRpcDispatch disp) { disp.RemoveSource(client); }
public override void removeFromDispatch(XmlRpcDispatch disp) { client.SegFault(); disp.RemoveSource(client); }