public class SocketReader implements TextReader:
Text reader over one socket connection.
import klyn.net
socket = Socket("example.com", 80)
try reader = socket.reader:
print(reader.readLine())| Modifier and Type | Member | Description |
|---|---|---|
| public | SocketReaderSocketReader(socket as Socket): |
Creates a text reader bound to a connected socket. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | closeclose() as Void throws IOException: |
Closes the underlying socket. |
| public | readAllTextreadAllText() as String throws IOException: |
Reads all remaining text from the socket. |
| public | readLinereadLine() as String throws IOException: |
Reads one line from the socket and consumes the transport line terminator. |
| public | readLinesreadLines() as ArrayList<String> throws IOException: |
Reads all remaining lines until the socket stream closes. |