Other Socket-Related Functions
In addition to the functions we have already seen, there are three Perl built-in functions related to sockets: send(), recv(), and socketpair(). We will use send() and recv() in later chapters of this book when we discuss TCP urgent data (Chapter 17), and the UDP protocol (Chapters 17–20).
|
$bytes = send (SOCK,$data,$flags[,$destination]) The send() function uses the socket indicated by the first argument to deliver the data indicated by $data, to the destination address indicated by $destination. If the data was successfully queued for transmission, send() returns the number of bytes sent; otherwise, it returns undef. The third argument, $flags, is the bitwise OR of zero or more of the two options listed in ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access