- '''Method to reject an incoming client.'''
- response = Command()
- response.id, response.name, response.type = 1, '_error', Message.RPC
- response.setArg(dict(level='status', code='NetConnection.Connect.Rejected',
- description=reason, details=None))
- self.writeMessage(response.toMessage())
-
- def call(self, method, *args):
- '''Call a (callback) method on the client.'''
- cmd = Command()
- cmd.id, cmd.name, cmd.type = self._nextCallId, method, (self.objectEncoding == 0.0 and Message.RPC or Message.RPC3)
- cmd.args, cmd.cmdData = args, None
- self._nextCallId += 1
- if _debug: print 'Client.call method=', method, 'args=', args, ' msg=', cmd.toMessage()
- self.writeMessage(cmd.toMessage())
+ '''Method to reject an incoming client. just close.
+ TODO: report back an HTTP error with "reason" in it.
+ '''
+ self.removeConnection()