-
- All Implemented Interfaces:
-
org.eclipse.paho.client.mqttv3.internal.NetworkModule
public class TCPNetworkModule implements NetworkModule
A network module for connecting over TCP.
-
-
Field Summary
Fields Modifier and Type Field Description protected Socketsocketprivate intreadTimeout
-
Constructor Summary
Constructors Constructor Description TCPNetworkModule(SocketFactory factory, String host, int port, String resourceContext, ILogger logger, IPahoEvents pahoEvents)Constructs a new TCPNetworkModule using the specified host and port.
-
Method Summary
Modifier and Type Method Description SocketgetSocket()voidsetReadTimeout(int timeout)voidstart()Starts the module, by creating a TCP socket to the server. InputStreamgetInputStream()OutputStreamgetOutputStream()voidstop()Stops the module, by closing the TCP socket. voidsetConnectTimeout(int timeout)Set the maximum time to wait for a socket to be established -
-
Constructor Detail
-
TCPNetworkModule
TCPNetworkModule(SocketFactory factory, String host, int port, String resourceContext, ILogger logger, IPahoEvents pahoEvents)
Constructs a new TCPNetworkModule using the specified host and port.
-
-
Method Detail
-
setReadTimeout
void setReadTimeout(int timeout)
-
start
void start()
Starts the module, by creating a TCP socket to the server.
-
getInputStream
InputStream getInputStream()
-
getOutputStream
OutputStream getOutputStream()
-
stop
void stop()
Stops the module, by closing the TCP socket.
-
setConnectTimeout
void setConnectTimeout(int timeout)
Set the maximum time to wait for a socket to be established
-
-
-
-