GNU Radio Manual and C++ API Reference 3.9.4.0
The Free & Open Software Radio Ecosystem
tcp_server_sink.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2014 Free Software Foundation, Inc.
4 *
5 * This file is part of GNU Radio
6 *
7 * SPDX-License-Identifier: GPL-3.0-or-later
8 *
9 */
10
11#ifndef INCLUDED_BLOCKS_TCP_SERVER_SINK_H
12#define INCLUDED_BLOCKS_TCP_SERVER_SINK_H
13
14#include <gnuradio/blocks/api.h>
15#include <gnuradio/sync_block.h>
16
17namespace gr {
18namespace blocks {
19
20/*!
21 * \brief Send stream through a TCP socket.
22 * \ingroup networking_tools_blk
23 *
24 * \details
25 * Listen for incoming TCP connection(s). Duplicate data for each
26 * opened connection. Optionally can wait until first client connects
27 * before streaming starts.
28 */
30{
31public:
32 // gr::blocks::tcp_server_sink::sptr
33 typedef std::shared_ptr<tcp_server_sink> sptr;
34
35 /*!
36 * \brief TCP Server Sink Constructor
37 *
38 * \param itemsize The size (in bytes) of the item datatype
39 * \param host The name or IP address of interface to bind to.
40 * \param port Port where to listen.
41 * \param noblock If false, wait until first client connects before
42 * streaming starts. In non blocking mode
43 * (noblock=true), drop data onto floor if no client
44 * is connected.
45 */
46 static sptr
47 make(size_t itemsize, const std::string& host, int port, bool noblock = false);
48};
49
50} /* namespace blocks */
51} /* namespace gr */
52
53#endif /* INCLUDED_BLOCKS_TCP_SERVER_SINK_H */
Send stream through a TCP socket.
Definition: tcp_server_sink.h:30
static sptr make(size_t itemsize, const std::string &host, int port, bool noblock=false)
TCP Server Sink Constructor.
std::shared_ptr< tcp_server_sink > sptr
Definition: tcp_server_sink.h:33
synchronous 1:1 input to output with history
Definition: sync_block.h:26
#define BLOCKS_API
Definition: gr-blocks/include/gnuradio/blocks/api.h:18
BLOCKS_API size_t itemsize(vector_type type)
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:29