Sends buffered data to the target
163432
def flush(self):
        
        # Flush buffer
        content = self._buffer.getvalue()
        self._buffer = StringIO()

        if content:
            # Send message
            self._client.send_message(self._target, content, mtype="chat")
59086
def _send(self, data):
        """"""
        try:
            self._sock.sendto(data.encode('ascii'), self._addr)
        except (socket.error, RuntimeError):
            # No time for love, Dr. Jones!
            pass
497474
def send(self):
        
        sent_chunks = 0
        chunk_num = self.index
        with open(self.filename, 'rb') as infile:
            infile.seek(self.index * self.chunk_size)
            while sent_chunks != self.num_chunks_to_send:
                chunk = infile.read(self.chunk_size)
                self._send_chunk(chunk, chunk_num)
                self.progress_queue.processed(1)
                chunk_num += 1
                sent_chunks += 1
1237150
def send(self, data):
        """"""
        self._send_data(int_to_hex(len(data)))

        self._send_data(data)
644258
private void writeBufferedData() throws IOException {
        if (buffer.length() > 0) {
            out.write(formatMessage(buffer.toString()).getBytes());
            out.write('\n');
            buffer = new StringBuffer();
        }
    }
740127
def send_buffer(self):
        
        buf = self._send_buf
        sock = self.connection._sock
        try:
            timeout = sock.gettimeout()
            sock.setblocking(False)
            try:
                for idx, item in enumerate(buf):
                    sent = 0
                    while 1:
                        try:
                            sent = sock.send(item)
                        except IOError as e:
                            if e.errno == errno.EAGAIN:
                                continue
                            elif e.errno == errno.EWOULDBLOCK:
                                break
                            raise
                        self.sent_something = True
                        break
                    if sent < len(item):
                        buf[:idx + 1] = [item[sent:]]
                        break
                else:
                    del buf[:]
            finally:
                sock.settimeout(timeout)
        except IOError as e:
            self.connection.disconnect()
            if isinstance(e, socket.timeout):
                raise TimeoutError('Timeout writing to socket (host %s)'
                                   % self.host_id)
            raise ConnectionError('Error while writing to socket (host %s): %s'
                                  % (self.host_id, e))
433736
protected function sendData()
    {
        foreach ($this->values as $index => $data) {
            foreach ($data as $xy) {
                list($x, $y) = $xy;
                $this->sendCommand($x.' '.$y);
            }
            $this->sendCommand('e');
        }
    }
1113718
def send(self, change):
        """"""
        self.buf.append(change)
        if len(self.buf) % self.BUF_SIZE == 0:
            self.flush()
570226
def send_stdout(cls, sock, payload):
    """"""
    cls.write_chunk(sock, ChunkType.STDOUT, payload)
84931
function send(data, cb) {
    if (enabled) {
      var send_data = new Buffer(data);
      try {
        socket.send(send_data, 0, send_data.length, port, host, function(err, bytes) {
          if (cb) {
            return cb(err, bytes);
          }
        });
      } catch (x) {
        // Purposely ignored..
        cb();
      }
    } else {
      cb();
    }
  }
668896
public void sendData() throws IOException {
        if (_writer != null) {
            _writer.write(_buffer.toString());
            _writer.flush();
            _buffer = new StringBuffer();
        }
    }
783420
def send(self, data: bytes = b""):
        
        self.input.extend(data)
        self._process()
1035134
def send(self, packet_buffer):
        
        if self._handle is None:
            raise self.DeviceIsNotOpen()
        buffer_length = len(packet_buffer)
        buf_send = ctypes.cast(ctypes.create_string_buffer(packet_buffer, buffer_length),
                               ctypes.POINTER(ctypes.c_ubyte))
        wtypes.pcap_sendpacket(self._handle, buf_send, buffer_length)
474053
function(newData, limit) {
            if ((this.buffer.length + newData.length) > options.limit) {
                this.buffer = this.buffer.concat(newData.slice(0, options.limit - this.buffer.length));
                self._sendDisplayLimitReachedMessage(limit);
            }
            else {
                this.buffer = this.buffer.concat(newData);
            }
        }
219270
def send(socket, data, num_bytes=20):
    
    pickled_data = pickle.dumps(data, -1)
    length = str(len(pickled_data)).zfill(num_bytes)
    socket.sendall(length.encode())
    socket.sendall(pickled_data)
246326
public void sendReply(final String buf) {
    sendBuffer(HttpResponseStatus.OK,
               ChannelBuffers.copiedBuffer(buf, CharsetUtil.UTF_8));
  }
55576
def __send_receive_buffer(self):
        
        self.__clear_in_buffer()
        self.__send_buffer()
        read_string = self.serial.read(len(self.__in_buffer))
        if self.DEBUG_MODE:
            print("Read: '{}'".format(binascii.hexlify(read_string)))
        if len(read_string) != len(self.__in_buffer):
            raise IOError("{} bytes received for input buffer of size {}".format(len(read_string),
                                                                                 len(self.__in_buffer)))
        if not self.__is_valid_checksum(read_string):
            raise IOError("Checksum validation failed on received data")
        self.__in_buffer.value = read_string