SocketReader
classin packageklyn.net
public class SocketReader implements TextReader
SocketReader
All Implemented Interfaces: TextReader

Text reader over one socket connection.

import klyn.net

socket = Socket("example.com", 80)
try reader = socket.reader:
    print(reader.readLine())
Constructors
Modifier and Type Member Description
public SocketReader
SocketReader(socket as Socket)
Creates a text reader bound to a connected socket.
Methods
Modifier and Type Member Description
public close
close() as Void throws IOException
Closes the underlying socket.
public readAllText
readAllText() as String throws IOException
Reads all remaining text from the socket.
public readLine
readLine() as String throws IOException
Reads one line from the socket and consumes the transport line terminator.
public readLines
readLines() as ArrayList<String> throws IOException
Reads all remaining lines until the socket stream closes.
Inherited Methods
methodInherited Methods from AutoClosable: close