gnuradio.blocks: Netwroking Tools

gnuradio.blocks.socket_pdu(string type, string addr, string port, int MTU = 10000) → sptr

Creates socket interface and translates traffic to PDUs.

Constructor Specific Documentation:

Construct a SOCKET PDU interface.

Parameters:
  • type – “TCP_SERVER”, “TCP_CLIENT”, “UDP_SERVER”, or “UDP_CLIENT”
  • addr – network address to use
  • port – network port to use
  • MTU – maximum transmission unit
socket_pdu_sptr.active_thread_priority(self) → int
socket_pdu_sptr.set_thread_priority(self, int priority) → int
socket_pdu_sptr.thread_priority(self) → int
gnuradio.blocks.tuntap_pdu(string dev, int MTU = 10000) → sptr

Creates TUNTAP interface and translates traffic to PDUs.

Constructor Specific Documentation:

Construct a TUNTAP PDU interface.

Parameters:
  • dev – Device name to create
  • MTU – Maximum Transmission Unit size
tuntap_pdu_sptr.active_thread_priority(self) → int
tuntap_pdu_sptr.set_thread_priority(self, int priority) → int
tuntap_pdu_sptr.thread_priority(self) → int
gnuradio.blocks.udp_sink(size_t itemsize, string host, int port, int payload_size = 1472, bool eof = True) → sptr

Write stream to an UDP socket.

Constructor Specific Documentation:

UDP Sink Constructor.

Parameters:
  • itemsize – The size (in bytes) of the item datatype
  • host – The name or IP address of the receiving host; use NULL or None for no connection
  • port – Destination port to connect to on receiving host
  • payload_size – UDP payload size by default set to 1472 = (1500 MTU - (8 byte UDP header) - (20 byte IP header))
  • eof – Send zero-length packet on disconnect
udp_sink_sptr.active_thread_priority(self) → int
udp_sink_sptr.connect(self, string host, int port)

Change the connection to a new destination.

Calls disconnect() to terminate any current connection first.

udp_sink_sptr.disconnect(self)

Send zero-length packet (if eof is requested) then stop sending.

Zero-byte packets can be interpreted as EOF by gr_udp_source. Note that disconnect occurs automatically when the sink is destroyed, but not when its top_block stops.

udp_sink_sptr.payload_size(self) → int

return the PAYLOAD_SIZE of the socket

udp_sink_sptr.set_thread_priority(self, int priority) → int
udp_sink_sptr.thread_priority(self) → int
gnuradio.blocks.udp_source(size_t itemsize, string host, int port, int payload_size = 1472, bool eof = True) → sptr

Read stream from an UDP socket.

Constructor Specific Documentation:

UDP Source Constructor.

Parameters:
  • itemsize – The size (in bytes) of the item datatype
  • host – The name or IP address of the receiving host; can be NULL, None, or “0.0.0.0” to allow reading from any interface on the host
  • port – The port number on which to receive data; use 0 to have the system assign an unused port number
  • payload_size – UDP payload size by default set to 1472 = (1500 MTU - (8 byte UDP header) - (20 byte IP header))
  • eof – Interpret zero-length packet as EOF (default: true)
udp_source_sptr.active_thread_priority(self) → int
udp_source_sptr.connect(self, string host, int port)

Change the connection to a new destination.

Calls disconnect() to terminate any current connection first.

udp_source_sptr.disconnect(self)

Cut the connection if we have one set up.

udp_source_sptr.get_port(self) → int

return the port number of the socket

udp_source_sptr.payload_size(self) → int

return the PAYLOAD_SIZE of the socket

udp_source_sptr.set_thread_priority(self, int priority) → int
udp_source_sptr.thread_priority(self) → int

Previous topic

gnuradio.blocks: Audio Signals

Next topic

gnuradio.blocks: Boolean Operators

This Page