SwapModem.Type| Modifier and Type | Method and Description |
|---|---|
void |
addListener(MessageListener l)
add a message listener to receive messages
|
void |
close()
disconnect and close the modem
|
String |
getHost()
Get the host the modem is connected to.
|
int |
getPort()
Get the TCP port the modem is connected to.
|
ModemSetup |
getSetup()
get the network setup
|
SwapModem.Type |
getType()
determine the type of virtual modem
|
boolean |
isOpen()
Check if the modem is open (connected to it's implementation device)
|
void |
open()
connect to the modem.
|
void |
removeListener(MessageListener l)
remove a listener
|
void |
send(SwapMessage msg)
send a message out onto the network
|
void |
setSetup(ModemSetup newSetup)
set the network setup
|
public TcpModem(String host, int port)
public void open()
throws TcpException
SwapModemopen in interface SwapModemTcpExceptionpublic void close()
throws SwapException
SwapModemclose in interface SwapModemSwapException - Thrown if there is a problem closing the modem.public boolean isOpen()
SwapModempublic void send(SwapMessage msg) throws SwapException
SwapModemsend in interface SwapModemmsg - Message to send.SwapException - Thrown if there a a problem sending a message to the modem.public void addListener(MessageListener l)
SwapModemaddListener in interface SwapModeml - listener to add.public void removeListener(MessageListener l)
SwapModemremoveListener in interface SwapModeml - listener to removepublic ModemSetup getSetup() throws SwapException
SwapModemgetSetup in interface SwapModemSwapException - Thrown if there is a problem
retrieving the setuppublic void setSetup(ModemSetup newSetup) throws SwapException
SwapModemsetSetup in interface SwapModemnewSetup - The modem setup to applySwapException - Thrown if there is a problem
applying the setuppublic SwapModem.Type getType()
SwapModempublic String getHost()
public int getPort()
Copyright © 2015. All rights reserved.