Sends only the content to the client (useful for SSE streaming). Headers
must be manually sent before calling this method.
967221
public function sendContent()
    {
        if (!is_null($this->contentCallback)) {
            $callback = new Callback($this->contentCallback);
            $callback->execute();
        }
        echo $this->content;
    }
1193564
def send(self, data, room=None, skip_sid=None, namespace=None,
             callback=None):
        
        return self.client.send(data, namespace=namespace or self.namespace,
                                callback=callback)
458498
async def _send(self, stream_id, pp_id, user_data,
                    expiry=None, max_retransmits=None, ordered=True):
        
        if ordered:
            stream_seq = self._outbound_stream_seq.get(stream_id, 0)
        else:
            stream_seq = 0

        fragments = math.ceil(len(user_data) / USERDATA_MAX_LENGTH)
        pos = 0
        for fragment in range(0, fragments):
            chunk = DataChunk()
            chunk.flags = 0
            if not ordered:
                chunk.flags = SCTP_DATA_UNORDERED
            if fragment == 0:
                chunk.flags |= SCTP_DATA_FIRST_FRAG
            if fragment == fragments - 1:
                chunk.flags |= SCTP_DATA_LAST_FRAG
            chunk.tsn = self._local_tsn
            chunk.stream_id = stream_id
            chunk.stream_seq = stream_seq
            chunk.protocol = pp_id
            chunk.user_data = user_data[pos:pos + USERDATA_MAX_LENGTH]

            # initialize counters
            chunk._abandoned = False
            chunk._acked = False
            chunk._book_size = len(chunk.user_data)
            chunk._expiry = expiry
            chunk._max_retransmits = max_retransmits
            chunk._misses = 0
            chunk._retransmit = False
            chunk._sent_count = 0
            chunk._sent_time = None

            pos += USERDATA_MAX_LENGTH
            self._local_tsn = tsn_plus_one(self._local_tsn)
            self._outbound_queue.append(chunk)

        if ordered:
            self._outbound_stream_seq[stream_id] = uint16_add(stream_seq, 1)

        # transmit outbound data
        if not self._t3_handle:
            await self._transmit()
747198
def output(self, stream, disabletransferencoding = None):
        
        if self._sendHeaders:
            raise HttpProtocolException('Cannot modify response, headers already sent')
        self.outputstream = stream
        try:
            content_length = len(stream)
        except Exception:
            pass
        else:
            self.header(b'Content-Length', str(content_length).encode('ascii'))
        if disabletransferencoding is not None:
            self.disabledeflate = disabletransferencoding
        self._startResponse()
796244
public function send()
    {
        $this->sendHeader();

        $body = $this->getBody();

        $body->rewind();

        echo $body->getContents();
    }
1374295
def send_chunk(type, content = nil)
      chunk = Chunk.new(type, content).to_s
      socket.write chunk
    end
116306
def send_headers(self):
        
        self.events.sync_emit('headers')
        self._set_default_headers()
        header_str = self.status_line + self.EOL + str(self.headers)
        self.stream.write(header_str.encode())
        self.events.sync_emit('after_headers')
935210
async def _send(self, request_bytes, body_bytes, h11_connection):
        '''
        
        '''
        await self.sock.send_all(h11_connection.send(request_bytes))
        if body_bytes is not None:
            await self.sock.send_all(h11_connection.send(body_bytes))
        await self.sock.send_all(h11_connection.send(h11.EndOfMessage()))
224860
def send_headers(self):
        
        hkeys = [key.lower() for key, value in self.outheaders]
        status = int(self.status[:3])
        
        if status == 413:
            # Request Entity Too Large. Close conn to avoid garbage.
            self.close_connection = True
        elif "content-length" not in hkeys:
            # "All 1xx (informational), 204 (no content),
            # and 304 (not modified) responses MUST NOT
            # include a message-body." So no point chunking.
            if status < 200 or status in (204, 205, 304):
                pass
            else:
                if (self.response_protocol == 'HTTP/1.1'
                    and self.method != 'HEAD'):
                    # Use the chunked transfer-coding
                    self.chunked_write = True
                    self.outheaders.append(("Transfer-Encoding", "chunked"))
                else:
                    # Closing the conn is the only way to determine len.
                    self.close_connection = True
        
        if "connection" not in hkeys:
            if self.response_protocol == 'HTTP/1.1':
                # Both server and client are HTTP/1.1 or better
                if self.close_connection:
                    self.outheaders.append(("Connection", "close"))
            else:
                # Server and/or client are HTTP/1.0
                if not self.close_connection:
                    self.outheaders.append(("Connection", "Keep-Alive"))
        
        if (not self.close_connection) and (not self.chunked_read):
            # Read any remaining request body data on the socket.
            # "If an origin server receives a request that does not include an
            # Expect request-header field with the "100-continue" expectation,
            # the request includes a request body, and the server responds
            # with a final status code before reading the entire request body
            # from the transport connection, then the server SHOULD NOT close
            # the transport connection until it has read the entire request,
            # or until the client closes the connection. Otherwise, the client
            # might not reliably receive the response message. However, this
            # requirement is not be construed as preventing a server from
            # defending itself against denial-of-service attacks, or from
            # badly broken client implementations."
            remaining = getattr(self.rfile, 'remaining', 0)
            if remaining > 0:
                self.rfile.read(remaining)
        
        if "date" not in hkeys:
            self.outheaders.append(("Date", rfc822.formatdate()))
        
        if "server" not in hkeys:
            self.outheaders.append(("Server", self.server.server_name))
        
        buf = [self.server.protocol + " " + self.status + CRLF]
        for k, v in self.outheaders:
            buf.append(k + ": " + v + CRLF)
        buf.append(CRLF)
        self.conn.wfile.sendall("".join(buf))
365153
def flush(self):
        
        # Flush buffer
        line = self._buffer.getvalue()
        self._buffer = StringIO()

        # Send the message
        content = {"session_id": self._session, "text": line}
        self._herald.fire(self._peer, beans.Message(MSG_CLIENT_PRINT, content))
527393
def send(self, url, data, headers):
        
        eventlet.spawn(self._send_payload, (url, data, headers))
373302
private void sendRequest(String header, byte[] body) throws IOException {
        // Send entire message in one write, else suffer the fate of weird TCP/IP stacks.
        byte[] headerBytes = Utils.toBytes(header);
        byte[] requestBytes = headerBytes;
        if (body != null && body.length > 0) {
            requestBytes = new byte[headerBytes.length + body.length];
            System.arraycopy(headerBytes, 0, requestBytes, 0, headerBytes.length);
            System.arraycopy(body, 0, requestBytes, headerBytes.length, body.length);
        }
        
        // Send the header and body (if any) and flush the result.
        m_outStream.write(requestBytes);
        m_outStream.flush();
    }
857164
public static void send(String to, String subject, String content, boolean isHtml, File... files) {
		send(splitAddress(to), subject, content, isHtml, files);
	}
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)')
681734
def broadcast(content)
      message = {
        id: SecureRandom.uuid,
        content: content
      }

      send_message('MSG_BROADCAST', message)
    end
297292
public function send()
    {
        $buffered_content = $this->returnAllOutputBuffers();
        if (!empty($buffered_content) && is_string($this->content)) {
            $this->content = $buffered_content . $this->content;
        }

        $this->content = $this->output->prepare($this);

        if (!is_string($this->content) && $this->content !== null) {
            $output = get_class($this->output);
            throw new \Parable\Http\Exception("Output class '{$output}' did not result in string or null content.");
        }

        if (!headers_sent()) {
            // @codeCoverageIgnoreStart
            header("{$this->request->getProtocol()} {$this->getHttpCode()} {$this->getHttpCodeText()}");
            header("Content-type: {$this->getContentType()}");
            foreach ($this->getHeaders() as $key => $value) {
                header("{$key}: {$value}");
            }
            // @codeCoverageIgnoreEnd
        }

        if ($this->isHeaderAndFooterContentEnabled()) {
            echo $this->getHeaderContent();
        }

        echo $this->getContent();

        if ($this->isHeaderAndFooterContentEnabled()) {
            echo $this->getFooterContent();
        }

        $this->terminate();
    }
542542
private function sendHeaders()
    {
        $this->useCookies();
        $this->setProtocolAndCode();
        header(
            sprintf(
                "Content-Type: %s; charset=%s",
                $this->getContentType(),
                $this->getCharset()
            )
        );

        if (count($this->getHeaders())) {
            foreach ($this->getHeaders() as $header) {

                header($header);
            }
        }
    }