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, setSentByprotected 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.IOExceptionpublic int getPort()
getPort in class MessageProcessorpublic void start()
throws IOException
start in class MessageProcessorIOExceptionpublic void stop()
stop in class MessageProcessorpublic String getTransport()
getTransport in class MessageProcessorpublic SIPTransactionStack getSIPStack()
getSIPStack in class MessageProcessorpublic MessageChannel createMessageChannel(HostPort targetHostPort) throws UnknownHostException
createMessageChannel in class MessageProcessorUnknownHostExceptionpublic MessageChannel createMessageChannel(InetAddress host, int port) throws IOException
MessageProcessorcreateMessageChannel in class MessageProcessorIOExceptionpublic int getDefaultTargetPort()
getDefaultTargetPort in class MessageProcessorpublic boolean isSecure()
isSecure in class MessageProcessorpublic int getMaximumMessageSize()
getMaximumMessageSize in class MessageProcessorpublic boolean inUse()
inUse in class MessageProcessorCopyright © 2014. All Rights Reserved.