public class TLSMessageChannel extends ConnectionOrientedMessageChannel
PipelinedMsgParser
isCached, isRunning, key, myAddress, myClientInputStream, myParser, myPort, mySock, mythread, peerAddress, peerAddressAdvertisedInHeaders, peerPort, peerPortAdvertisedInHeaders, peerProtocol, sipStack
messageProcessor, useCount
Modifier | Constructor and Description |
---|---|
protected |
TLSMessageChannel(InetAddress inetAddr,
int port,
SIPTransactionStack sipStack,
TLSMessageProcessor messageProcessor)
Constructor - connects to the given inet address.
|
protected |
TLSMessageChannel(Socket sock,
SIPTransactionStack sipStack,
TLSMessageProcessor msgProcessor,
String threadName)
Constructor - gets called from the SIPStack class with a socket on
accepting a new client.
|
Modifier and Type | Method and Description |
---|---|
void |
close(boolean removeSocket,
boolean stopKeepAliveTask)
Close the message channel.
|
boolean |
equals(Object other)
Equals predicate.
|
HandshakeCompletedListenerImpl |
getHandshakeCompletedListener() |
String |
getTransport()
get the transport string.
|
void |
handleException(ParseException ex,
SIPMessage sipMessage,
Class hdrClass,
String header,
String message)
Exception processor for exceptions detected from the parser.
|
boolean |
isHandshakeCompleted() |
boolean |
isSecure()
TLS Is a secure protocol.
|
void |
run()
This gets invoked when thread.start is called from the constructor.
|
protected void |
sendMessage(byte[] msg,
boolean retry)
Send message to whoever is connected to us.
|
void |
sendMessage(byte[] message,
InetAddress receiverAddress,
int receiverPort,
boolean retry)
Send a message to a specified address.
|
void |
setHandshakeCompleted(boolean handshakeCompleted) |
void |
setHandshakeCompletedListener(HandshakeCompletedListener handshakeCompletedListenerImpl) |
cancelPingKeepAliveTimeoutTaskIfStarted, close, getKeepAliveTimeout, getKey, getPeerAddress, getPeerInetAddress, getPeerPacketSourceAddress, getPeerPacketSourcePort, getPeerPort, getPeerProtocol, getSIPStack, getViaHost, getViaPort, isReliable, processMessage, processMessage, rescheduleKeepAliveTimeout, sendMessage, sendSingleCLRF, setKeepAliveTimeout, uncache
createBadReqRes, getEncapsulatedClientTransaction, getHost, getHostPort, getKey, getKey, getMessageProcessor, getPeerHostPort, getPort, getRawIpSourceAddress, getViaHeader, getViaHostPort, logMessage, logResponse, sendMessage, sendMessage, setEncapsulatedClientTransaction
protected TLSMessageChannel(Socket sock, SIPTransactionStack sipStack, TLSMessageProcessor msgProcessor, String threadName) throws IOException
sock
- Socket from which to read and write messages. The socket is
already connected (was created as a result of an accept).sipStack
- Ptr to SIP StackmsgProcessor
- -- the message processor that created us.IOException
protected TLSMessageChannel(InetAddress inetAddr, int port, SIPTransactionStack sipStack, TLSMessageProcessor messageProcessor) throws IOException
inetAddr
- inet address to connect to.sipStack
- is the sip sipStack from which we are created.messageProcessor
- -- the message processor that created us.IOException
- if we cannot connect.public void close(boolean removeSocket, boolean stopKeepAliveTask)
close
in class ConnectionOrientedMessageChannel
public String getTransport()
getTransport
in class MessageChannel
protected void sendMessage(byte[] msg, boolean retry) throws IOException
sendMessage
in class ConnectionOrientedMessageChannel
msg
- is the message to send.retry
- IOException
public void sendMessage(byte[] message, InetAddress receiverAddress, int receiverPort, boolean retry) throws IOException
sendMessage
in class MessageChannel
message
- Pre-formatted message to send.receiverAddress
- Address to send it to.receiverPort
- Receiver port.IOException
- If there is a problem connecting or sending.public void handleException(ParseException ex, SIPMessage sipMessage, Class hdrClass, String header, String message) throws ParseException
sipMessage
- -- the message that incurred the error.ex
- -- parse exception detected by the parser.header
- -- header that caused the error.message
- -- message where this header was detected.ParseException
- Thrown if we want to reject the message.public boolean equals(Object other)
public boolean isSecure()
isSecure
in class MessageChannel
public void setHandshakeCompletedListener(HandshakeCompletedListener handshakeCompletedListenerImpl)
public HandshakeCompletedListenerImpl getHandshakeCompletedListener()
public void run()
ConnectionOrientedMessageChannel
run
in interface Runnable
run
in class ConnectionOrientedMessageChannel
public boolean isHandshakeCompleted()
public void setHandshakeCompleted(boolean handshakeCompleted)
handshakeCompleted
- the handshakeCompleted to setCopyright © 2015. All Rights Reserved.