public class TcpTransportConnection extends java.lang.Object implements SipTransportConnection
Constructor and Description |
---|
TcpTransportConnection(IpAddress remote_ipaddr,
int remote_port,
SipTransportConnectionListener listener)
Creates a new TcpTransportConnection.
|
TcpTransportConnection(TcpSocket socket,
SipTransportConnectionListener listener)
Creates a new TcpTransportConnection.
|
Modifier and Type | Method and Description |
---|---|
long |
getLastTimeMillis()
Gets the last time the Connection has been used (in millisconds).
|
IpAddress |
getLocalAddress()
Gets the local IpAddress.
|
int |
getLocalPort()
Gets the local port.
|
java.lang.String |
getProtocol()
Gets protocol type.
|
IpAddress |
getRemoteAddress()
Gets the remote IpAddress.
|
int |
getRemotePort()
Gets the remote port.
|
void |
halt()
Stops running.
|
void |
sendMessage(SipMessage msg)
Sends a SipMessage.
|
void |
setListener(SipTransportConnectionListener listener)
Sets the SipTransportConnection listener.
|
java.lang.String |
toString()
Gets a String representation of the Object.
|
public TcpTransportConnection(IpAddress remote_ipaddr, int remote_port, SipTransportConnectionListener listener) throws java.io.IOException
java.io.IOException
public TcpTransportConnection(TcpSocket socket, SipTransportConnectionListener listener)
socket
- the TCP socketlistener
- the TcpTransportConnection listenerpublic void setListener(SipTransportConnectionListener listener)
setListener
in interface SipTransportConnection
public java.lang.String getProtocol()
getProtocol
in interface SipTransportConnection
public IpAddress getRemoteAddress()
getRemoteAddress
in interface SipTransportConnection
public int getRemotePort()
getRemotePort
in interface SipTransportConnection
public IpAddress getLocalAddress()
getLocalAddress
in interface SipTransportConnection
public int getLocalPort()
getLocalPort
in interface SipTransportConnection
public long getLastTimeMillis()
getLastTimeMillis
in interface SipTransportConnection
public void sendMessage(SipMessage msg) throws java.io.IOException
sendMessage
in interface SipTransportConnection
java.io.IOException
public void halt()
halt
in interface SipTransportConnection
public java.lang.String toString()
toString
in class java.lang.Object