FreeBSD Manual Pages
dnsjit.output.tcpcli(3) Library Functions Manual dnsjit.output.tcpcli(3) NAME dnsjit.output.tcpcli - Simple, length aware, TCP client SYNOPSIS local output = require("dnsjit.output.tcpcli").new("127.0.0.1", "53") DESCRIPTION Simple TCP client that takes any payload you give it, sends the length of the payload as an unsigned 16 bit integer and then sends the pay- load. When receiving it will first retrieve the length of the payload as an unsigned 16 bit integer and it will stall until it gets, even if nonblocking mode is used. Then it will retrieve at least that amount of bytes, if nonblocking mode is used here then it will return a pay- load object with length zero if there was nothing to receive or if the full payload have not been received yet. Additional calls will con- tinue retrieving the payload. Attributes timeout A core.timespec that is used when producing objects. Functions Tcpcli.new() Create a new Tcpcli output. Tcpcli:timeout(seconds, nanoseconds) Set the timeout when producing objects. Tcpcli:connect(host, port) Connect to the host and port and return 0 if successful. Tcpcli:nonblocking(bool) Enable (true) or disable (false) nonblocking mode and return 0 if successful, if bool is not specified then return if nonblock- ing mode is on (true) or off (false). Tcpcli:receive() Return the C functions and context for receiving objects, these objects will be sent. Tcpcli:produce() Return the C functions and context for producing objects, these objects are received. If nonblocking mode is enabled the pro- ducer will return a payload object with length zero if there was nothing to receive or if the full payload have not been received yet. If nonblocking mode is disabled the producer will wait for data and if timed out (see timeout) it will return a payload ob- ject with length zero. If a timeout happens during during the first stage, getting the length, it will fail and return nil. Additional calls will continue retrieving the payload. The pro- ducer returns nil on error. Tcpcli:packets() Return the number of "packets" sent, actually the number of com- pletely sent payloads. Tcpcli:received() Return the number of "packets" received, actually the number of completely received DNS messages. Tcpcli:errors() Return the number of errors when sending. AUTHORS and CONTRIBUTORS Jerry Lundstrm (DNS-OARC), Tom Kek (CZ.NIC), Petr paek (ISC) Maintained by DNS-OARC https://www.dns-oarc.net/ BUGS For issues and feature requests please use: https://github.com/DNS-OARC/dnsjit/issues For question and help please use: admin@dns-oarc.net dnsjit 1.4.0 dnsjit.output.tcpcli(3)
NAME | SYNOPSIS | DESCRIPTION | AUTHORS and CONTRIBUTORS | BUGS
Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=dnsjit.output.tcpcli&sektion=3&manpath=FreeBSD+Ports+14.3.quarterly>