public final class StringSockets extends Object
Modifier and Type | Class and Description |
---|---|
static class |
StringSockets.Builder |
Constructor and Description |
---|
StringSockets() |
Modifier and Type | Method and Description |
---|---|
static rx.Observable<String> |
from(rx.functions.Func0<Socket> socketCreator,
long quietTimeoutMs,
long reconnectDelayMs,
Charset charset,
rx.Scheduler scheduler) |
static StringSockets.Builder |
from(String host)
Returns a builder for converting a socket read to an Observable.
|
static rx.Observable<String> |
from(String host,
int port,
long quietTimeoutMs,
long reconnectDelayMs,
Charset charset,
rx.Scheduler scheduler)
Returns an Observable sequence of strings (not lines) from the given host
and port.
|
static void |
main(String[] args) |
static rx.Observable<String> |
mergeLinesFrom(rx.Observable<HostPort> hostPorts) |
static rx.Observable<String> |
mergeLinesFrom(rx.Observable<HostPort> hostPorts,
int maxLineLength) |
static rx.Observable<String> |
mergeLinesFrom(rx.Observable<HostPort> hostPorts,
rx.Scheduler scheduler) |
static rx.Observable<String> |
mergeLinesFrom(rx.Observable<HostPort> hostPorts,
rx.Scheduler scheduler,
int maxLineLength) |
static rx.Observable<String> |
strings(rx.functions.Func0<Socket> socketCreator,
Charset charset) |
static rx.Observable<String> |
strings(String host,
int port,
int quietTimeoutMs,
Charset charset) |
public static rx.Observable<String> from(String host, int port, long quietTimeoutMs, long reconnectDelayMs, Charset charset, rx.Scheduler scheduler)
quietTimeoutMs
then a
reconnect will be attempted. Note that this is a good idea with TCPIP
connections as for instance a firewall can simply drop a quiet connection
without the client being aware of it. If any exception occurs a reconnect
will be attempted after reconnectDelayMs
. If the socket is
closed by the server (the end of the input stream is reached) then a
reconnect is attempted after reconnectDelayMs
.hostPort
- public static rx.Observable<String> from(rx.functions.Func0<Socket> socketCreator, long quietTimeoutMs, long reconnectDelayMs, Charset charset, rx.Scheduler scheduler)
public static StringSockets.Builder from(String host)
host
- public static rx.Observable<String> strings(String host, int port, int quietTimeoutMs, Charset charset)
public static rx.Observable<String> strings(rx.functions.Func0<Socket> socketCreator, Charset charset)
public static rx.Observable<String> mergeLinesFrom(rx.Observable<HostPort> hostPorts, rx.Scheduler scheduler)
public static rx.Observable<String> mergeLinesFrom(rx.Observable<HostPort> hostPorts, int maxLineLength)
public static rx.Observable<String> mergeLinesFrom(rx.Observable<HostPort> hostPorts, rx.Scheduler scheduler, int maxLineLength)
public static rx.Observable<String> mergeLinesFrom(rx.Observable<HostPort> hostPorts)
public static void main(String[] args)
Copyright © 2020. All rights reserved.