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() |
String |
getServerURI() |
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 NetworkModuleIOExceptionMqttExceptionpublic InputStream getInputStream() throws IOException
getInputStream in interface NetworkModuleIOExceptionpublic OutputStream getOutputStream() throws IOException
getOutputStream in interface NetworkModuleIOExceptionpublic void stop()
throws IOException
stop in interface NetworkModuleIOExceptionpublic void setConnectTimeout(int timeout)
timeout - public String getServerURI()
getServerURI in interface NetworkModuleCopyright © 2018 Eclipse Paho. All Rights Reserved.