Sends the connect message
185549
function _connect() {
        if (!_isDisconnected()) {
            var bayeuxMessage = {
                id: _nextMessageId(),
                channel: '/meta/connect',
                connectionType: _transport.getType()
            };

            // In case of reload or temporary loss of connection
            // we want the next successful connect to return immediately
            // instead of being held by the server, so that connect listeners
            // can be notified that the connection has been re-established
            if (!_connected) {
                bayeuxMessage.advice = { timeout: 0 };
            }

            _setStatus('connecting');
            _cometd._debug('Connect sent', bayeuxMessage);
            _send(false, [bayeuxMessage], true, 'connect');
            _setStatus('connected');
        }
    }
575522
def send(self, data):
        
        self.logger.debug('Send data: {}'.format(data))

        if not self.connected:
            self.logger.warning('Connection not established. Return...')
            return

        self.websocket.send(json.dumps(data))
235064
def send_message(msg, type = 'TextMessage')
      connect do |http|
        request = http_request(:post, "/room/#{room_id}/speak.json")
        request.body = { :message => { :body => msg, :type => type } }.to_json
        response = http.request(request)

        case response
        when Net::HTTPCreated
          true
        else
          raise ConnectionError,
            "Error sending message '#{msg}' (#{response.class})"
        end
      end
    end
553794
def send(self, message):
        
        try:
            self.ws.send(json.dumps(message))
        except websocket._exceptions.WebSocketConnectionClosedException:
            raise SelenolWebSocketClosedException()
1170551
public void send(Destination dest, Message msg) throws MessagingException {
        try {
            Session s =
                    connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            MessageProducer p = s.createProducer(dest);
            p.send(msg);
            s.close();
        } catch (JMSException e) {
            throw new MessagingException(e.getMessage(), e);
        }

        if(logger.isDebugEnabled()) {
            logger.debug("send() - message sent to destination " + dest);
        }
    }
359419
def send(self, message_type, data, connection_id, callback=None,
             one_way=False):
        
        if connection_id not in self._connections:
            raise ValueError("Unknown connection id: {}".format(connection_id))
        connection_info = self._connections.get(connection_id)
        if connection_info.connection_type == \
                ConnectionType.ZMQ_IDENTITY:
            message = validator_pb2.Message(
                correlation_id=_generate_id(),
                content=data,
                message_type=message_type)

            timer_tag = get_enum_name(message.message_type)
            timer_ctx = self._get_send_response_timer(timer_tag).time()
            fut = future.Future(
                message.correlation_id,
                message.content,
                callback,
                timeout=self._connection_timeout,
                timer_ctx=timer_ctx)
            if not one_way:
                self._futures.put(fut)

            self._send_receive_thread.send_message(msg=message,
                                                   connection_id=connection_id)
            return fut

        return connection_info.connection.send(
            message_type,
            data,
            callback=callback,
            one_way=one_way)
962337
def send_message(self, message):
        
        if self._error:
            raise compat.saved_exc(self._error)
        elif self._transport is None:
            raise JsonRpcError('not connected')
        self._version.check_message(message)
        self._writer.write(serialize(message))
320318
async def send_notification(self, method, args=()):
        ''''''
        message = self.connection.send_notification(Notification(method, args))
        await self._send_message(message)
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) {
			}
		}
	}
935167
def send(self, data):
        """"""
        # send message
        _LOGGER.debug("send: " + data)
        self.socket.send(data.encode('ascii'))
        # sleep needed to prevent flooding the GC100 with sends
        sleep(.01)
166581
def connect(self):
        '''
        
        '''
        if self.connected:
            raise RuntimeError(
                '{} is connected already'.format(self.__class__.__name__))
        if self.closed:
            raise RuntimeError(
                '{} is closed already'.format(self.__class__.__name__))
        self.connected = True
        self._connect()
583447
def send(self, msg, timeout=None, tries=None):
        '''
        
        '''
        if not self.connected():
            yield self.connect()
        pack = salt.transport.frame.frame_msg_ipc(msg, raw_body=True)
        yield self.stream.write(pack)
397318
def send_message(self, msg):
        

        if self.socket is not None:

            msg.version = self.PROTOCOL_VERSION
            serialized = msg.SerializeToString()
            data = struct.pack(">I", len(serialized)) + serialized

            #print("Sending message: %s" % msg)
            try:
                self.socket.send(data)
            except Exception as e:
                #self.state = "Disconnected"
                pass
405048
def _send(self, data):
        """"""
        if not self._sock:
            self.connect()
        self._do_send(data)
704412
def sendConnect(self, data):
        """"""
        # Imported dynamically - Not used if only one broker
        if self.backend == 'ZMQ':
            import zmq
            self.context = zmq.Context()
            self.socket = self.context.socket(zmq.DEALER)
            self.socket.setsockopt(zmq.IDENTITY, b'launcher')
            self.socket.connect(
                "tcp://127.0.0.1:{port}".format(
                    port=self.brokerPort,
                )
            )
            self.socket.send_multipart([b"CONNECT",
                                        pickle.dumps(data,
                                                     pickle.HIGHEST_PROTOCOL)])
        else:
            # TODO
            pass
733171
public void onConnect() {
        input.setDisabled(false);
        sendingButton.setDisabled(false);
        connectingButton.setDisabled(true);
        disconnectingButton.setDisabled(false);
    }
196804
public void sendMessage(Message message) throws NotConnectedException, InterruptedException {
        message.setTo(room);
        message.setType(Message.Type.groupchat);
        connection.sendStanza(message);
    }