Sends a complete ping message using blocking IO

@param data The data to send
@param wsChannel The web socket channel
430820
public static void sendPingBlocking(final ByteBuffer data, final WebSocketChannel wsChannel) throws IOException {
        sendBlockingInternal(data, WebSocketFrameType.PING, wsChannel);
    }
1281308
private void sendAdminPacket(ProtocolHeader header, Protocol protocol) throws IOException{
        clientSocket.sendPacket(header, protocol);
    }
142130
public static void sendPingBlocking(final PooledByteBuffer pooledData, final WebSocketChannel wsChannel) throws IOException {
        sendBlockingInternal(pooledData, WebSocketFrameType.PING, wsChannel);
    }
1354747
def send(self, data):
        
        while not self.stopped():
            try:
                self.ws.send(data)
                return
            except websocket.WebSocketConnectionClosedException:
                # config.LOGGER.debug('WebSocket closed, retrying send.') # TODO(investigate infinite loop)
                time.sleep(0.1)
75737
public static void sendTextBlocking(final String message, final WebSocketChannel wsChannel) throws IOException {
        final ByteBuffer data = ByteBuffer.wrap(message.getBytes(StandardCharsets.UTF_8));
        sendBlockingInternal(data, WebSocketFrameType.TEXT, wsChannel);
    }
1145968
public void write(final String data) throws IOException {
        if (socket != null) {
            out.write(data.getBytes());
        }
    }
199028
def send_packet(data)
      # Raise exception if we aren't connected
      raise MQTT::NotConnectedException unless connected?

      # Only allow one thread to write to socket at a time
      @write_semaphore.synchronize do
        @socket.write(data.to_s)
      end
    end
1322665
public void setBackRouteHeader(byte[] data) {
        // here in data is whole message, we want first 5 bytes!
        int thisPointCode = Mtp3.dpc(data, 1);
        int remotePointCode = Mtp3.opc(data, 1);
        int sls = Mtp3.sls(data, 1);
        int si = Mtp3.si(data);
        int ssi = Mtp3.ssi(data);
        // this.mtp3Header = new byte[5];
        MTPUtility.writeRoutingLabel(mtp3Header, si, ssi, sls, remotePointCode, thisPointCode);
        if (logger.isInfoEnabled()) {
            logger.info("DPC[" + remotePointCode + "] OPC[" + thisPointCode + "] SLS[" + sls + "] SI[" + si + "] SSI[" + ssi
                    + "] Label" + Arrays.toString(mtp3Header));
        }
    }
583523
def send(self, data, flags=0):
        '''
        
        '''
        if self._remote_addr == (None,None):
            raise sockerr("ENOTCONN: socket not connected")
        return self._send(data, self._flowaddr())
869116
public void send(String uri, String data) {
        Objects.requireNonNull(uri, Required.URI.toString());

        final Set<ServerSentEventConnection> uriConnections = getConnections(uri);
        if (uriConnections != null) {
            uriConnections.stream()
                .filter(ServerSentEventConnection::isOpen)
                .forEach((ServerSentEventConnection connection) -> connection.send(data));
            
       }
    }
864104
public synchronized void send(String data, String event, String id, EventCallback callback) {
        if (open == 0 || shutdown) {
            if (callback != null) {
                callback.failed(this, data, event, id, new ClosedChannelException());
            }
            return;
        }
        queue.add(new SSEData(event, data, id, callback));
        sink.getIoThread().execute(new Runnable() {
            @Override
            public void run() {
                synchronized (ServerSentEventConnection.this) {
                    if (pooled == null) {
                        fillBuffer();
                        writeListener.handleEvent(sink);
                    }
                }
            }
        });
    }
822034
void sendBufferSync(ByteBuffer bb) {
       try {
           /* configure socket to be blocking
            * so that we dont have to do write in
            * a tight while loop
            */
           sock.configureBlocking(true);
           if (bb != closeConn) {
               if (sock != null) {
                   sock.write(bb);
               }
               packetSent();
           }
       } catch (IOException ie) {
           LOG.error("Error sending data synchronously ", ie);
       }
    }
1263183
def send(self, data):
        
        try:
            self.socket.sendto(data.encode('utf8') + b'\n', (self.host, self.port))
        except (socket.error, RuntimeError):
            # Socket errors should fail silently so they don't affect anything else
            pass
760570
function _send($data)
    {
        switch ($this->mode) {
            case self::MODE_SSH2:
                $this->ssh->_send_channel_packet(SSH2::CHANNEL_EXEC, $data);
                break;
            case self::MODE_SSH1:
                $data = pack('CNa*', NET_SSH1_CMSG_STDIN_DATA, strlen($data), $data);
                $this->ssh->_send_binary_packet($data);
        }
    }
204167
function send($data)
    {
        $len = strlen($data);
        $n = socket_sendto($this->sock, $data, $len, 0, $this->host, $this->port);

        if ($n === false or $n < $len) {
            $this->set_error();
            return false;
        } else {
            return $n;
        }
    }
1050590
function ws_send(socket, data) {
	//console.log("send: " + data);
	let header;
	let payload = new Buffer.from(data);
	const len = payload.length;
	
	if (len <= 125) {
		header = new Buffer.alloc(2);
		header[1] = len;
	} else if (len <= 0xffff) {
		header = new Buffer.alloc(4);
		header[1] = 126;
		header[2] = (len >> 8) & 0xff;
		header[3] = len & 0xff;
	} else { /* 0xffff < len <= 2^63 */
		header = new Buffer(10);
		header[1] = 127;
		header[2] = (len >> 56) & 0xff;
		header[3] = (len >> 48) & 0xff;
		header[4] = (len >> 40) & 0xff;
		header[5] = (len >> 32) & 0xff;
		header[6] = (len >> 24) & 0xff;
		header[7] = (len >> 16) & 0xff;
		header[8] = (len >> 8) & 0xff;
		header[9] = len & 0xff;
	}
	
	header[0] = 0x81;
	socket.write(Buffer.concat([header, payload],
		 header.length + payload.length), 'binary');
	//console.log('sent ' + data.length + ' bytes');
}
619598
public static void sendBinaryBlocking(final ByteBuffer data, final WebSocketChannel wsChannel) throws IOException {
        sendBlockingInternal(data, WebSocketFrameType.BINARY, wsChannel);
    }