Send a message to one or more connected clients.

        The only difference with the :func:`socketio.Server.send` method is
        that when the ``namespace`` argument is not given the namespace
        associated with the class is used.
333396
def send(self, data, room=None, skip_sid=None, namespace=None,
             callback=None):
        
        return self.server.send(data, room=room, skip_sid=skip_sid,
                                namespace=namespace or self.namespace,
                                callback=callback)
611094
def send_message(msg)
      # Build the message and get it's size
      message = msg.serialize_to_string
      message_size = [message.length].pack('N')

      # Try to send the message
      try_again = true
      begin
        data = ""
        @ssl_client.write(message_size + message)
        @ssl_client.readpartial(1000,data)
      rescue
        # Sometimes our connection might drop or something, so
        # we'll reconnect to the unit and try to send the message again.
        if try_again
          try_again = false
          connect_to_unit
          retry
        else
          # Looks like we couldn't connect to the unit after all.
          puts "message not sent"
        end
      end

      return data
    end
969289
def send!(msg)
      attempts = 0
      begin
        attempts += 1
        client.send(msg)
      rescue Errno::EPIPE, IOError => e
        sleep 1
        disconnect
        reconnect
        retry unless attempts > 3
        raise e
      rescue Errno::ECONNRESET => e
        sleep (attempts^2) * 60 + 60
        disconnect
        reconnect
        retry unless attempts > 3
        raise e
      end
    end
694375
@Override
	protected void send() {
		String msg = namespace + '|' + nodeID + '|' + port;

		// Send broadcast packet
		DatagramSocket udpSocket = null;
		try {
			byte[] bytes = msg.getBytes();
			udpSocket = new DatagramSocket();
			udpSocket.setBroadcast(true);
			udpSocket.setReuseAddress(udpReuseAddr);
			InetAddress address = InetAddress.getByName(udpAddress);
			DatagramPacket packet = new DatagramPacket(bytes, bytes.length, address, udpPort);
			udpSocket.send(packet);
			if (debug) {
				logger.info("Broadcast message submitted (namespace: " + namespace + ", node ID: " + nodeID + ", port: "
						+ port + ").");
			}
		} catch (Exception cause) {
			logger.error("Unable to send broadcast packet!", cause);
		} finally {
			try {
				if (udpSocket != null) {
					udpSocket.close();
				}
				udpSocket = null;
			} catch (Exception ignored) {
			}
		}
	}
445938
def send(self, event, message):
        
        self.connection.send({
            'reason': ['request', 'send'],
            'content': {
                'reason': event,
                'request_id': self.request_counter,
                'content': message,
            },
        })
        self.request_counter = self.request_counter + 1
494149
def send(session_id, message):
    
    try:
        socket = CLIENTS[session_id][1]
    except KeyError:
        raise NoSocket("There is no socket with the session ID: " + session_id)
    socket.send(message)
1325331
def method_missing(name, *args, &block) # :nodoc:
      if writable_master.respond_to?(name)
        Client.send(:send_to_master, name)
        send(name, *args, &block)
      else
        super
      end
    end
811199
def send(self, data, opcode=websocket.ABNF.OPCODE_TEXT):
        
        self.ws_client.send(data, opcode)
137961
def send_message(body, options = {})
      logger.debug "Sending message: #{body}"
      client.send_message id, domain, body, options
    end
770823
def send(self, body, content_type='application/ubjson', timeout=5):
        
        if self.__send_ready.wait(timeout):
            try:
                with self.__send_lock:
                    # access denied response might be received inside send thread rather than here how to best handle?
                    self.__send_channel.basic_publish(msg=Message(body, delivery_mode=2, content_type=content_type),
                                                      exchange=self.__epid)
            except exceptions.AccessRefused as exc:
                raise_from(LinkException('Access denied'), exc)
            except (exceptions.AMQPError, SocketError) as exc:
                raise_from(LinkException('amqp/transport failure'), exc)
            except Exception as exc:  # pylint: disable=broad-except
                raise_from(LinkException('unexpected failure'), exc)
        else:
            exc = self.__send_exc
            if exc:
                raise_from(LinkException('Sender unavailable'), exc)
            else:
                raise LinkException('Sender unavailable (unknown error)')
437480
function sendMessage(client, to, message, callback) {
	resolveID(client, to, function(channelID) {
		client._req('post', Endpoints.MESSAGES(channelID), message, function(err, res) {
			handleResCB("Unable to send messages", err, res, callback);
		});
	});
}
1350755
def send_message(self, message):
        
        if not isinstance(message, txdbus.DbusMessage):
            raise TypeError('message: expecting DbusMessage instance (got {!r})',
                                type(message).__name__)
        self._name_acquired.wait()
        if self._error:
            raise compat.saved_exc(self._error)
        elif self._transport is None:
            raise DbusError('not connected')
        self._writer.write(message.rawMessage)
327565
def send(self, data, room=None, include_self=True, namespace=None,
             callback=None):
        """"""
        return self.socketio.send(data, room=room, include_self=include_self,
                                  namespace=namespace or self.namespace,
                                  callback=callback)
28003
def sendmess(self, msgtype, payload, flags=0, size=0, offset=0, timeout=0):
        

        # reuse last valid connection or create new
        conn = self.conn or self._new_connection()
        # invalidate last connection
        self.conn = None

        flags |= self.flags
        assert (flags & FLG_PERSISTENCE)
        ret, rflags, data = conn.req(
            msgtype, payload, flags, size, offset, timeout)
        if rflags & FLG_PERSISTENCE:
            # persistence granted, save connection object for reuse
            self.conn = conn
        else:
            # discard connection object
            conn.shutdown()

        return ret, data
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
648661
def send_client_message(message)
      Slanger::Redis.publish(message['channel'], Oj.dump(message, mode: :compat)) if authenticated?
    end
955697
def _send(self, ip, port, data):
        
        return self._listen_socket.sendto(data, (ip, port))