Set the host:port for the Cellular device to send data to.

        Returns True if the command was successful.
430474
def modem_configuration(self, host, port):
        
        request = {
            "command": "modem_configuration",
            "host": host,
            "port": port
        }
        status = self._check_command_response_status(request)
        return status
259854
def _serial_send(self, port, payload):
        '''
        
        '''
        if port not in self.open_devices:
            # Not connected to device.
            logger.error('Error sending data: `%s` not connected', port)
            self._publish_status(port)
        else:
            try:
                device = self.open_devices[port]
                device.write(payload)
                logger.debug('Sent data to `%s`', port)
            except Exception as exception:
                logger.error('Error sending data to `%s`: %s', port, exception)
259858
def set_tunnel(self, host, port=None, headers=None):
        
        self._tunnel_host = host
        self._tunnel_port = port
        if headers:
            self._tunnel_headers = headers
        else:
            self._tunnel_headers.clear()
151331
def port_has_listener(address, port):
    
    cmd = ['nc', '-z', address, str(port)]
    result = subprocess.call(cmd)
    return not(bool(result))
492524
def send_remote_port(self):
        
        msg = "REMOTE TCP %s" % (str(self.transport.getPeer().port))
        self.send_line(msg)
1071451
def sendport(host, port) # :nodoc:
      af = (@sock.peeraddr)[0]
      if af == "AF_INET"
        cmd = "PORT " + (host.split(".") + port.divmod(256)).join(",")
      elsif af == "AF_INET6"
        cmd = sprintf("EPRT |2|%s|%d|", host, port)
      else
        raise FTPProtoError, host
      end
      voidcmd(cmd)
    end
1177224
def send_command(self, command):
        ''''''
        data = {"command": command, "device_id": self.device_id}
        try:
            response = self.api_iface._api_post("/api/v2/commands", data)
            return Command(response, self)
        except APIError as e:
            print("API error: ")
            for key,value in e.data.iteritems:
                print(str(key) + ": " + str(value))
221716
public boolean setMasterHostFail() {
    if (masterHostFail.compareAndSet(false, true)) {
      masterHostFailNanos = System.nanoTime();
      currentConnectionAttempts.set(0);
      return true;
    }
    return false;
  }
354638
async def send(self, data, destination):
        
        if isinstance(destination, str):
            host, port = destination.split(':')
            destination = host, int(port)

        await self.requests.put({
            'data': data,
            'destination': destination
        })
557841
protected boolean setConnector() {
		if (this.host == null) {
			log.error("No host value set, cannot set up socket connector.");
			return false;
		}
		if (this.port < 0 || this.port > 65535) {
			log.error("Port value is invalid {}.", Integer.valueOf(this.port));
			return false;
		}
		if (this.executors == null) {
			this.executors = new ExecutorFilter(1);
		}
		this.connector = new NioSocketConnector();
		this.connector.getSessionConfig().setWriterIdleTime(
				SolverWorldModelInterface.TIMEOUT_PERIOD /2);
		this.connector.getSessionConfig().setReaderIdleTime(
				(int) Math.ceil(TIMEOUT_PERIOD * 1.1));
		if (!this.connector.getFilterChain().contains(
				WorldModelSolverProtocolCodecFactory.CODEC_NAME)) {
			this.connector.getFilterChain().addLast(
					WorldModelSolverProtocolCodecFactory.CODEC_NAME,
					new ProtocolCodecFilter(
							new WorldModelSolverProtocolCodecFactory(true)));
		}
		this.connector.getFilterChain().addLast("ExecutorPool", this.executors);
		this.connector.setHandler(this.ioHandler);
		log.debug("Connector set up successful.");
		return true;
	}
174891
function SerialDevice(port, settings, Connection) {

  // call super class
  Device.call(this, Connection);

  this.set('portName', port);
  this.set('settings', settings);

  this.set('state', 'close');
}
63415
def Tethering_bind(self, port):
		
		assert isinstance(port, (int,)
		    ), "Argument 'port' must be of type '['int']'. Received type: '%s'" % type(
		    port)
		subdom_funcs = self.synchronous_command('Tethering.bind', port=port)
		return subdom_funcs
842964
def _send(self, message):
        
        if not message.recipients():
            return False
        try:
            self.connection.sendmail(
                message.sender,
                message.recipients(),
                message.message().as_string(),
            )
        except Exception as e:
            logger.error(
                "Error sending a message to server %s:%s: %s",
                self.host,
                self.port,
                e,
            )
            if not self.fail_silently:
                raise
            return False
        return True
273563
def send (self, command, *args, **kwargs):
        
        status   = False
        cmdobj   = self._cmddict.create(command, *args, **kwargs)
        messages = []

        if not cmdobj.validate(messages):
            for msg in messages:
                log.error(msg)
        else:
            encoded = cmdobj.encode()

            if self._verbose:
                size = len(cmdobj.name)
                pad  = (size - len(cmdobj.name) + 1) * ' '
                gds.hexdump(encoded, preamble=cmdobj.name + ':' + pad)

            try:
                values = (self._host, self._port, str(cmdobj))
                log.command('Sending to %s:%d: %s' % values)
                self._socket.sendto(encoded, (self._host, self._port))
                status = True

                with pcap.open(self.CMD_HIST_FILE, 'a') as output:
                    output.write(str(cmdobj))
            except socket.error as e:
                log.error(e.message)
            except IOError as e:
                log.error(e.message)

        return status
979802
def _set_address(self, address, force=None):
        
        force = force if force is not None else self.force
        if self.address != address or self._force_last != force:
            if force is True:
                ioctl(self.fd, I2C_SLAVE_FORCE, address)
            else:
                ioctl(self.fd, I2C_SLAVE, address)
            self.address = address
            self._force_last = force
480826
def SetServerInformation(self, server, port):
    
    self._host = server
    self._port = port
80728
def connect(self, (host, port)):
        '''
        
        '''
        self._host = "%s:%s" % (host, port)
        self._sock = EventSocket(
            read_cb=self._sock_read_cb,
            close_cb=self._sock_close_cb,
            error_cb=self._sock_error_cb,
            debug=self.connection.debug,
            logger=self.connection.logger)
        if self.connection._sock_opts:
            for k, v in self.connection._sock_opts.iteritems():
                family, type = k
                self._sock.setsockopt(family, type, v)
        self._sock.setblocking(False)
        self._sock.connect(
            (host, port), timeout=self.connection._connect_timeout)
        self._heartbeat_timeout = None