Transact with server.
329115
def register(self):
        
        self._queue.put(hello_packet(socket.gethostname(), mac(), __version__))
        self._queue.put(request_packet(MSG_SERVER_SETTINGS))
        self._queue.put(request_packet(MSG_SAMPLE_FORMAT))
        self._queue.put(request_packet(MSG_HEADER))
299195
def send(self, p):
        """"""
        with self.send_mutex:
            self.begin_send(p)

            # Wait until the tx callback is called
            self.tx_done.wait()
            if self.tx_exception is not None:
                raise Scapy_Exception(self.tx_exception)
            return
972570
def serve(self, host='127.0.0.1', port=5000):
        """"""
        from meinheld import server, middleware
        # self.app.run(host=host, port=port)
        server.listen((host, port))
        server.run(middleware.WebSocketMiddleware(self.app))
1360012
def refresh_from_server(self):
        """"""
        group = self.manager.get(id=self.id)
        self.__init__(self.manager, **group.data)
772995
def send_response(self, transaction):
        
        if transaction.cacheHit is False:
            """
            handling response based on the code
            """
            logger.debug("handling response")
            self._handle_response(transaction)
        return transaction
380958
function send() {
		// Check form for errors
		if(!$("#transaction").val()) return alert('Missing parameter !');

		// Send
		nem.com.requests.transaction.announce(endpoint, $("#transaction").val()).then(function(res) {
			// If code >= 2, it's an error
			if (res.code >= 2) {
				alert(res.message);
			} else {
				alert(res.message);
			}
		}, function(err) {
			alert(err);
		})
	}
653873
def transaction(self, collections, action, waitForSync = False, lockTimeout = None, params = None) :
        """"""
        payload = {
                "collections": collections,
                "action": action,
                "waitForSync": waitForSync}
        if lockTimeout is not None:
                payload["lockTimeout"] = lockTimeout
        if params is not None:
            payload["params"] = params

        self.connection.reportStart(action)

        r = self.connection.session.post(self.transactionURL, data = json.dumps(payload, default=str))

        self.connection.reportItem()

        data = r.json()

        if (r.status_code == 200 or r.status_code == 201 or r.status_code == 202) and not data.get("error") :
            return data
        else :
            raise TransactionError(data["errorMessage"], action, data)
326492
def process_allow_action(processors, action, argument):
    """"""
    for processor in processors:
        processor(action, argument)
    db.session.commit()
785636
function execute(req, res) {
  var t = systime();
  res.send(null, [t.s, t.m]);
}
747282
def request_echo(self, sock, msg):
        """"""
        return katcp.Message.reply(msg.name, "ok", *msg.arguments)
336578
def submit(self):
        """"""
        if self.api._req_lixian_add_task_bt(self):
            self.submitted = True
            return True
        return False
211171
function execute(req, res) {
  this.state.pubsub.subscribe(req.conn, req.args);
}
1030726
def connect(self, object, callback):
		""""""
		def signal_fired(sender, object, iface, signal, params):
			callback(*params)
		return object._bus.subscribe(sender=object._bus_name, object=object._path, iface=self._iface_name, signal=self.__name__, signal_fired=signal_fired)
440035
function execute(req, res) {
  // setup the transaction
  req.conn.transaction = new Transaction();
  res.send(null, Constants.OK);
}
139901
def _api_action(url, req, data=None):
    """"""
    requisite_headers = {'Accept': 'application/json',
                         'Content-Type': 'application/json'}
    auth = (user, token)

    if req == "GET":
        response = requests.get(url, headers=requisite_headers, auth=auth)
    elif req == "PUT":
        response = requests.put(url, headers=requisite_headers, auth=auth,
                                data=data)
    elif req == "POST":
        response = requests.post(url, headers=requisite_headers, auth=auth,
                                 data=data)
    elif req == "DELETE":
        response = requests.delete(url, headers=requisite_headers, auth=auth)

    return response.status_code, response.text
1083743
def grab_server(self, onerror = None):
        """"""
        request.GrabServer(display = self.display,
                           onerror = onerror)
193731
function send_command(RequiresSession, Command, Parameters, callback) {

			// Check for requirements.
			if (RequiresSession && !Member.session_id) {
				if (callback) { callback(Error('No existing session found. Login required.'), null); }
				return;
			}

			// Start a new transaction.
			var transaction_id = 'TX-' + unique_id();

			// Set up the one time response handler.
			Socket.once(Command + '.' + transaction_id,
				function(Err, Response) {
					if (callback) { callback(Err, Response); }
					return;
				});

			// Clone the command parameters and mark it with our control structure.
			var parameters = JSON.parse(JSON.stringify(Parameters));
			parameters.control = {
				transaction_id: transaction_id,
				session_id: Member.session_id
			};

			// Invoke the function.
			Socket.emit(Command, parameters);

			return;
		}