///<summary>Constructor with port and address.</summary> ///<remarks>This constructor sets up a TcpListener listening on the ///given port and address. It also calls a Thread on the method StartListen().</remarks> ///<param name="address"><c>IPAddress</c> value of the address to listen on.</param> ///<param name="port"><c>Int</c> value of the port to listen on.</param> public XmlRpcServer(IPAddress address, int port) { this._port = port; this._address = address; this._handlers = new Hashtable(); this._system = new XmlRpcSystemObject(this); this._wc = new WaitCallback(this.WaitCallback); }
///<summary>Constructor with port and address.</summary> ///<remarks>This constructor sets up a TcpListener listening on the ///given port and address. It also calls a Thread on the method StartListen().</remarks> ///<param name="address"><c>IPAddress</c> value of the address to listen on.</param> ///<param name="port"><c>Int</c> value of the port to listen on.</param> public XmlRpcServer(IPAddress address, int port) { _port = port; _address = address; _handlers = new Hashtable(); _system = new XmlRpcSystemObject(this); _wc = new WaitCallback(WaitCallback); }
///<summary>Invoke a method on a named handler.</summary> ///<param name="objectName"><c>String</c> The name of the handler.</param> ///<param name="methodName"><c>String</c> The name of the method to invoke on the handler.</param> ///<param name="parameters"><c>IList</c> The parameters to invoke the method with.</param> /// <seealso cref="XmlRpcSystemObject.Invoke"/> public Object Invoke(String objectName, String methodName, IList parameters) { Object target = this._handlers[objectName]; if (target == null) { throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD, string.Format("{0}: Object {1} not found", XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG, objectName)); } return(XmlRpcSystemObject.Invoke(target, methodName, parameters)); }
///<summary>Invoke a method on a named handler.</summary> ///<param name="objectName"><c>String</c> The name of the handler.</param> ///<param name="methodName"><c>String</c> The name of the method to invoke on the handler.</param> ///<param name="parameters"><c>IList</c> The parameters to invoke the method with.</param> /// <seealso cref="XmlRpcSystemObject.Invoke"/> public Object Invoke(String objectName, String methodName, IList parameters) { Object target = _handlers[objectName]; if (target == null) { throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD, XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": Object " + objectName + " not found"); } return(XmlRpcSystemObject.Invoke(target, methodName, parameters)); }