public class TCPNetworkModule extends Object implements NetworkModule
Constructor and Description |
---|
TCPNetworkModule(SocketFactory factory,
String host,
int port,
String resourceContext)
Constructs a new TCPNetworkModule using the specified host and
port.
|
Modifier and Type | Method and Description |
---|---|
InputStream |
getInputStream() |
OutputStream |
getOutputStream() |
void |
setConnectTimeout(int timeout)
Set the maximum time to wait for a socket to be established
|
void |
start()
Starts the module, by creating a TCP socket to the server.
|
void |
stop()
Stops the module, by closing the TCP socket.
|
protected Socket socket
public TCPNetworkModule(SocketFactory factory, String host, int port, String resourceContext)
public void start() throws IOException, MqttException
start
in interface NetworkModule
IOException
MqttException
public InputStream getInputStream() throws IOException
getInputStream
in interface NetworkModule
IOException
public OutputStream getOutputStream() throws IOException
getOutputStream
in interface NetworkModule
IOException
public void stop() throws IOException
stop
in interface NetworkModule
IOException
public void setConnectTimeout(int timeout)
timeout
- Copyright © 2019 Eclipse Paho. All rights reserved.