public class UDPMessageProcessor extends MessageProcessor implements Runnable
Modifier and Type | Field and Description |
---|---|
protected boolean |
isRunning
A flag that is set to false to exit the message processor (suggestion by
Jeff Keyser).
|
protected LinkedList |
messageChannels
A list of message channels that we have started.
|
protected BlockingQueue<DatagramQueuedMessageDispatch> |
messageQueue
Incoming messages are queued here.
|
protected DatagramSocket |
sock |
protected int |
threadPoolSize
Max # of udp message channels
|
IN_ADDR_ANY, IN6_ADDR_ANY, sipStack, transport
Modifier | Constructor and Description |
---|---|
protected |
UDPMessageProcessor(InetAddress ipAddress,
SIPTransactionStack sipStack,
int port)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
MessageChannel |
createMessageChannel(HostPort targetHostPort)
Create and return new TCPMessageChannel for the given host/port.
|
MessageChannel |
createMessageChannel(InetAddress host,
int port)
Create a message channel for the specified host/port.
|
int |
getDefaultTargetPort()
Default target port for UDP
|
int |
getMaximumMessageSize()
UDP can handle a message as large as the MAX_DATAGRAM_SIZE.
|
int |
getPort()
Get port on which to listen for incoming stuff.
|
SIPTransactionStack |
getSIPStack()
Returns the stack.
|
String |
getTransport()
Return the transport string.
|
boolean |
inUse()
Return true if there are any messages in use.
|
boolean |
isSecure()
UDP is not a secure protocol.
|
void |
run()
Thread main routine.
|
void |
start()
Start our processor thread.
|
void |
stop()
Shut down the message processor.
|
getDefaultPort, getIpAddress, getListeningPoint, getSavedIpAddress, getSentBy, getViaHeader, initialize, isSentBySet, setIpAddress, setListeningPoint, setSentBy
protected BlockingQueue<DatagramQueuedMessageDispatch> messageQueue
protected LinkedList messageChannels
protected int threadPoolSize
protected DatagramSocket sock
protected boolean isRunning
protected UDPMessageProcessor(InetAddress ipAddress, SIPTransactionStack sipStack, int port) throws IOException
sipStack
- pointer to the stack.IOException
public int getPort()
getPort
in class MessageProcessor
public void start() throws IOException
start
in class MessageProcessor
IOException
public void stop()
stop
in class MessageProcessor
public String getTransport()
getTransport
in class MessageProcessor
public SIPTransactionStack getSIPStack()
getSIPStack
in class MessageProcessor
public MessageChannel createMessageChannel(HostPort targetHostPort) throws UnknownHostException
createMessageChannel
in class MessageProcessor
UnknownHostException
public MessageChannel createMessageChannel(InetAddress host, int port) throws IOException
MessageProcessor
createMessageChannel
in class MessageProcessor
IOException
public int getDefaultTargetPort()
getDefaultTargetPort
in class MessageProcessor
public boolean isSecure()
isSecure
in class MessageProcessor
public int getMaximumMessageSize()
getMaximumMessageSize
in class MessageProcessor
public boolean inUse()
inUse
in class MessageProcessor
Copyright © 2018. All Rights Reserved.