public class NioWebSocketMessageChannel extends NioTcpMessageChannel
channelMap, lastActivityTimeStamp, socketChannel
isCached, isRunning, key, myAddress, myClientInputStream, myParser, myPort, mySock, mythread, peerAddress, peerAddressAdvertisedInHeaders, peerPort, peerPortAdvertisedInHeaders, peerProtocol, sipStack
messageProcessor, useCount
Modifier | Constructor and Description |
---|---|
|
NioWebSocketMessageChannel(InetAddress inetAddress,
int port,
SIPTransactionStack sipStack,
NioTcpMessageProcessor nioTcpMessageProcessor) |
protected |
NioWebSocketMessageChannel(SIPTransactionStack stack,
NioTcpMessageProcessor nioTcpMessageProcessor,
SocketChannel socketChannel) |
Modifier and Type | Method and Description |
---|---|
protected void |
addBytes(byte[] bytes) |
static NioWebSocketMessageChannel |
create(SIPTransactionStack stack,
NioWebSocketMessageProcessor nioTcpMessageProcessor,
SocketChannel socketChannel) |
String |
getTransport()
get the transport string.
|
void |
onNewSocket(byte[] message) |
void |
processMessage(SIPMessage message)
Call back method.
|
void |
rewriteUri(SipURI uri) |
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 |
sendMessage(SIPMessage sipMessage,
InetAddress receiverAddress,
int receiverPort)
Send a message given SIP message.
|
protected void |
sendNonWebSocketMessage(byte[] msg,
boolean isClient) |
void |
sendWrapped(byte[] message,
InetAddress receiverAddress,
int receiverPort,
boolean retry) |
static byte[] |
wrapBufferIntoWebSocketFrame(byte[] buffer,
boolean client) |
close, create, equals, getLastActivityTimestamp, getMessageChannel, getSocketChannel, handleException, isSecure, putMessageChannel, readChannel, removeMessageChannel, sendTCPMessage
cancelPingKeepAliveTimeoutTaskIfStarted, close, getKeepAliveTimeout, getKey, getPeerAddress, getPeerInetAddress, getPeerPacketSourceAddress, getPeerPacketSourcePort, getPeerPort, getPeerProtocol, getSIPStack, getViaHost, getViaPort, isReliable, processMessage, rescheduleKeepAliveTimeout, run, sendMessage, sendSingleCLRF, setKeepAliveTimeout, uncache
createBadReqRes, getEncapsulatedClientTransaction, getHost, getHostPort, getKey, getKey, getMessageProcessor, getPeerHostPort, getPort, getRawIpSourceAddress, getViaHeader, getViaHostPort, logMessage, logResponse, sendMessage, setEncapsulatedClientTransaction
protected NioWebSocketMessageChannel(SIPTransactionStack stack, NioTcpMessageProcessor nioTcpMessageProcessor, SocketChannel socketChannel) throws IOException
IOException
public NioWebSocketMessageChannel(InetAddress inetAddress, int port, SIPTransactionStack sipStack, NioTcpMessageProcessor nioTcpMessageProcessor) throws IOException
IOException
public static NioWebSocketMessageChannel create(SIPTransactionStack stack, NioWebSocketMessageProcessor nioTcpMessageProcessor, SocketChannel socketChannel) throws IOException
IOException
protected void sendMessage(byte[] msg, boolean isClient) throws IOException
NioTcpMessageChannel
sendMessage
in class NioTcpMessageChannel
msg
- is the message to send.IOException
protected void sendNonWebSocketMessage(byte[] msg, boolean isClient) throws IOException
IOException
public static byte[] wrapBufferIntoWebSocketFrame(byte[] buffer, boolean client)
public void sendWrapped(byte[] message, InetAddress receiverAddress, int receiverPort, boolean retry) throws IOException
IOException
public void sendMessage(byte[] message, InetAddress receiverAddress, int receiverPort, boolean retry) throws IOException
NioTcpMessageChannel
sendMessage
in class NioTcpMessageChannel
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 sendMessage(SIPMessage sipMessage, InetAddress receiverAddress, int receiverPort) throws IOException
MessageChannel
sendMessage
in class MessageChannel
sipMessage
- is the messge to send.receiverAddress
- is the address to which we want to sendreceiverPort
- is the port to which we want to sendIOException
protected void addBytes(byte[] bytes) throws Exception
addBytes
in class NioTcpMessageChannel
Exception
public String getTransport()
NioTcpMessageChannel
getTransport
in class NioTcpMessageChannel
public void onNewSocket(byte[] message)
onNewSocket
in class NioTcpMessageChannel
public void processMessage(SIPMessage message) throws Exception
processMessage
in interface SIPMessageListener
processMessage
in interface RawMessageChannel
processMessage
in class ConnectionOrientedMessageChannel
message
- Exception
for the method that gets called
on parse exception.
public void rewriteUri(SipURI uri)
Copyright © 2017. All Rights Reserved.