AddSource() public method

public AddSource ( XmlRpcSource source, EventType eventMask ) : void
source XmlRpcSource
eventMask EventType
return void
示例#1
0
        // Create the socket connection to the server if necessary
        private bool setupConnection()
        {
            // If an error occurred last time through, or if the server closed the connection, close our end
            if ((_connectionState != ConnectionState.NO_CONNECTION && _connectionState != ConnectionState.IDLE) || _eof)
            {
                close();
            }
            _eof = false;
            if (_connectionState == ConnectionState.NO_CONNECTION)
            {
                if (!doConnect())
                {
                    return(false);
                }
            }

            // Prepare to write the request
            _connectionState = ConnectionState.WRITE_REQUEST;
            _bytesWritten    = 0;

            // Notify the dispatcher to listen on this source (calls handleEvent when the socket is writable)
            _disp.RemoveSource(this); // Make sure nothing is left over
            _disp.AddSource(this, XmlRpcDispatch.EventType.WritableEvent | XmlRpcDispatch.EventType.Exception);

            return(true);
        }
示例#2
0
 public override void addToDispatch(XmlRpcDispatch disp)
 {
     if (disp == null)
         return;
     if (check())
         return;
     disp.AddSource(client, (XmlRpcDispatch.EventType.WritableEvent | XmlRpcDispatch.EventType.Exception));
 }