NAME
Ion::Conn - An Ion TCP socket connection
VERSION
version 0.08
METHODS
host
Returns the peer host IP.
port
Returns the peer port.
connect
Connects to the remote host unless already connected.
Writes data to the socket. The line is automatically appended with the value of $/
.
readline
Returns the next line of data received on the socket. This method will cede control of the thread until a complete line is available. The value will have already been chomped to remove the line terminator ($/
).
close
Closes the socket. After calling this method, the connection object may not be reopened.
encodes
Adds a subroutine to process outgoing messages to this client. Encoder subs are applied in the order in which they are added.
decodes
Adds a subroutine to decode incoming messages from this client. Decoder subs are applied in the order in which they are added.
OVERLOADED OPERATORS
<>
Calls "readline".
${} (e.g. $conn-
($data)>)
Calls "print".
>>, <<=
Calls encodes.
<<, <<=
Calls decodes.
AUTHOR
Jeff Ober <sysread@fastmail.fm>
COPYRIGHT AND LICENSE
This software is copyright (c) 2018 by Jeff Ober.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.