public class NioTcpMessageChannel extends ConnectionOrientedMessageChannel
| Modifier and Type | Field and Description |
|---|---|
protected static HashMap<SocketChannel,NioTcpMessageChannel> |
channelMap |
protected long |
lastActivityTimeStamp |
protected SocketChannel |
socketChannel |
isCached, isRunning, key, myAddress, myClientInputStream, myParser, myPort, mySock, mythread, peerAddress, peerAddressAdvertisedInHeaders, peerPort, peerPortAdvertisedInHeaders, peerProtocol, sipStackmessageProcessor, useCount| Modifier | Constructor and Description |
|---|---|
|
NioTcpMessageChannel(InetAddress inetAddress,
int port,
SIPTransactionStack sipStack,
NioTcpMessageProcessor nioTcpMessageProcessor) |
protected |
NioTcpMessageChannel(NioTcpMessageProcessor nioTcpMessageProcessor,
SocketChannel socketChannel) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addBytes(byte[] bytes) |
protected void |
close(boolean removeSocket,
boolean stopKeepAliveTask) |
static NioTcpMessageChannel |
create(NioTcpMessageProcessor nioTcpMessageProcessor,
SocketChannel socketChannel) |
boolean |
equals(Object other)
Equals predicate.
|
long |
getLastActivityTimestamp() |
static NioTcpMessageChannel |
getMessageChannel(SocketChannel socketChannel) |
SocketChannel |
getSocketChannel() |
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 |
isSecure()
TCP Is not a secure protocol.
|
void |
onNewSocket(byte[] message) |
static void |
putMessageChannel(SocketChannel socketChannel,
NioTcpMessageChannel nioTcpMessageChannel) |
void |
readChannel() |
static void |
removeMessageChannel(SocketChannel socketChannel) |
protected void |
sendMessage(byte[] msg,
boolean isClient)
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 |
sendTCPMessage(byte[] message,
InetAddress receiverAddress,
int receiverPort,
boolean retry)
Send a message to a specified address.
|
cancelPingKeepAliveTimeoutTaskIfStarted, close, getKeepAliveTimeout, getKey, getPeerAddress, getPeerInetAddress, getPeerPacketSourceAddress, getPeerPacketSourcePort, getPeerPort, getPeerProtocol, getSIPStack, getViaHost, getViaPort, isReliable, processMessage, processMessage, rescheduleKeepAliveTimeout, run, sendMessage, sendSingleCLRF, setKeepAliveTimeout, uncachecreateBadReqRes, getEncapsulatedClientTransaction, getHost, getHostPort, getKey, getKey, getMessageProcessor, getPeerHostPort, getPort, getRawIpSourceAddress, getViaHeader, getViaHostPort, logMessage, logResponse, sendMessage, sendMessage, setEncapsulatedClientTransactionprotected static HashMap<SocketChannel,NioTcpMessageChannel> channelMap
protected SocketChannel socketChannel
protected long lastActivityTimeStamp
protected NioTcpMessageChannel(NioTcpMessageProcessor nioTcpMessageProcessor, SocketChannel socketChannel) throws IOException
IOExceptionpublic NioTcpMessageChannel(InetAddress inetAddress, int port, SIPTransactionStack sipStack, NioTcpMessageProcessor nioTcpMessageProcessor) throws IOException
IOExceptionpublic static NioTcpMessageChannel create(NioTcpMessageProcessor nioTcpMessageProcessor, SocketChannel socketChannel) throws IOException
IOExceptionpublic static NioTcpMessageChannel getMessageChannel(SocketChannel socketChannel)
public static void putMessageChannel(SocketChannel socketChannel, NioTcpMessageChannel nioTcpMessageChannel)
public static void removeMessageChannel(SocketChannel socketChannel)
public void readChannel()
public SocketChannel getSocketChannel()
protected void close(boolean removeSocket,
boolean stopKeepAliveTask)
close in class ConnectionOrientedMessageChannelpublic String getTransport()
getTransport in class MessageChannelprotected void sendMessage(byte[] msg,
boolean isClient)
throws IOException
sendMessage in class ConnectionOrientedMessageChannelmsg - is the message to send.isClient - IOExceptionpublic void sendMessage(byte[] message,
InetAddress receiverAddress,
int receiverPort,
boolean retry)
throws IOException
sendMessage in class MessageChannelmessage - 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 sendTCPMessage(byte[] message,
InetAddress receiverAddress,
int receiverPort,
boolean retry)
throws IOException
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 onNewSocket(byte[] message)
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 MessageChannelpublic long getLastActivityTimestamp()
Copyright © 2014. All Rights Reserved.