|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mobicents.protocols.smpp.net.AbstractStreamLink
org.mobicents.protocols.smpp.net.TcpLink
public class TcpLink
Implementation of an Smsc link over the tcp/ip protocol
| Field Summary | |
|---|---|
static int |
DEFAULT_PORT
Default IP port to use if none are specified. |
| Constructor Summary | |
|---|---|
TcpLink(InetAddress address)
Create a new TcpLink |
|
TcpLink(InetAddress address,
int port)
Create a new TcpLink |
|
TcpLink(Socket socket)
Create a new TcpLink object around an existing socket. |
|
TcpLink(String address)
Create a new TcpLink |
|
TcpLink(String address,
int port)
Create a new TcpLink |
|
| Method Summary | |
|---|---|
void |
connect()
Initiate the connection to the SMSC. |
void |
disconnect()
Close the connection to the SMSC. |
InetAddress |
getAddress()
Get the address we're connected (or connecting) to. |
int |
getConnectedPort()
Get the port at the SMSC that this link is connected to. |
protected InputStream |
getInputStream()
Get the input stream of the Socket connection to the SMSC. |
int |
getLocalPort()
Get the local port number this link is connected to. |
protected OutputStream |
getOutputStream()
Get the output stream of the Socket connection to the SMSC. |
int |
getPort()
Get the service port to connect to at the SMSC to establish a TCP connection. |
int |
getTimeout()
Get the current timeout for the underlying link. |
boolean |
isConnected()
Determine if the underlying link is connected to the SMSC. |
boolean |
isTimeoutSupported()
Determine if this SMSC link supports read timeouts. |
void |
setTimeout(int timeout)
Set the socket timeout. |
| Methods inherited from class org.mobicents.protocols.smpp.net.AbstractStreamLink |
|---|
available, flush, getAutoFlush, read, setAutoFlush, setInputStream, setOutputStream, setSnoopStreams, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_PORT
| Constructor Detail |
|---|
public TcpLink(String address)
throws UnknownHostException
address - IP address or hostname of SMSC
UnknownHostException - If the host is not found.
public TcpLink(String address,
int port)
throws UnknownHostException
address - IP address or hostname of SMSCport - The port number to connect to
UnknownHostException - If the host is not found.public TcpLink(InetAddress address)
address - IP address SMSC
UnknownHostException - If the host is not found.
public TcpLink(InetAddress address,
int port)
address - IP address of SMSCport - The port number to connect to
UnknownHostException - If the host is not found.
public TcpLink(Socket socket)
throws IOException
socket - The socket to use for communications.
IOException| Method Detail |
|---|
public InetAddress getAddress()
public int getPort()
public int getConnectedPort()
throws IOException
IOException - If the connection is not open.
public int getLocalPort()
throws IOException
IOException - If the connection is not open.public boolean isConnected()
SmscLink
true if connected, false otherwise.public void setTimeout(int timeout)
timeout - The timeout to set.SmscLink.setTimeout(int)public int getTimeout()
SmscLinkUnsupportedOperationException.
SmscLink.setTimeout(int)public boolean isTimeoutSupported()
SmscLink
true if the implementation supports read timeouts,
false if not.
public void connect()
throws IOException
SmscLink
IOException
public void disconnect()
throws IOException
AbstractStreamLinkSession.unbind()) before
closing the underlying network link. The connection may be reestablished
using #open.
disconnect in interface SmscLinkdisconnect in class AbstractStreamLinkIOException
protected OutputStream getOutputStream()
throws IOException
IOException - If the socket connection is not open or an I/O error occurs
when creating the output stream.OutputStream,
Socket.getOutputStream()
protected InputStream getInputStream()
throws IOException
IOException - If the socket connection is not open or an I/O error occurs
when creating the input stream.InputStream,
Socket.getInputStream()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||