gov.nist.javax.sip.stack
Class TCPMessageProcessor

java.lang.Object
  extended by gov.nist.javax.sip.stack.MessageProcessor
      extended by gov.nist.javax.sip.stack.ConnectionOrientedMessageProcessor
          extended by gov.nist.javax.sip.stack.TCPMessageProcessor
All Implemented Interfaces:
Runnable

public class TCPMessageProcessor
extends ConnectionOrientedMessageProcessor

Sit in a loop waiting for incoming tcp connections and start a new thread to handle each new connection. This is the active object that creates new TCP MessageChannels (one for each new accept socket).

Version:
1.2 $Revision: 1.35 $ $Date: 2010-12-02 22:04:13 $
Author:
M. Ranganathan

Field Summary
 
Fields inherited from class gov.nist.javax.sip.stack.ConnectionOrientedMessageProcessor
incomingMessageChannels, isRunning, messageChannels, nConnections, sock, useCount
 
Fields inherited from class gov.nist.javax.sip.stack.MessageProcessor
IN_ADDR_ANY, IN6_ADDR_ANY, sipStack, transport
 
Constructor Summary
protected TCPMessageProcessor(InetAddress ipAddress, SIPTransactionStack sipStack, int port)
          Constructor.
 
Method Summary
 MessageChannel createMessageChannel(HostPort targetHostPort)
          Create a message channel for the specified host/port.
 MessageChannel createMessageChannel(InetAddress host, int port)
          Create a message channel for the specified host/port.
 int getDefaultTargetPort()
          Default target port for TCP
 String getTransport()
          Return the transport string.
 boolean isSecure()
          TCP is not a secure protocol.
 void run()
          Run method for the thread that gets created for each accept socket.
 void start()
          Start the processor.
 void stop()
          Stop the message processor.
 
Methods inherited from class gov.nist.javax.sip.stack.ConnectionOrientedMessageProcessor
cacheMessageChannel, closeReliableConnection, getMaximumMessageSize, getSIPStack, inUse, remove, setKeepAliveTimeout, validatePortInRange
 
Methods inherited from class gov.nist.javax.sip.stack.MessageProcessor
getDefaultPort, getIpAddress, getListeningPoint, getPort, getSavedIpAddress, getSentBy, getViaHeader, initialize, isSentBySet, setIpAddress, setListeningPoint, setSentBy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TCPMessageProcessor

protected TCPMessageProcessor(InetAddress ipAddress,
                              SIPTransactionStack sipStack,
                              int port)
Constructor.

Parameters:
sipStack - SIPStack structure.
port - port where this message processor listens.
Method Detail

start

public void start()
           throws IOException
Start the processor.

Specified by:
start in class MessageProcessor
Throws:
IOException

run

public void run()
Run method for the thread that gets created for each accept socket.

Specified by:
run in interface Runnable
Specified by:
run in class MessageProcessor

getTransport

public String getTransport()
Return the transport string.

Overrides:
getTransport in class MessageProcessor
Returns:
the transport string

stop

public void stop()
Stop the message processor. Feature suggested by Jeff Keyser.

Specified by:
stop in class MessageProcessor

createMessageChannel

public MessageChannel createMessageChannel(HostPort targetHostPort)
                                    throws IOException
Description copied from class: MessageProcessor
Create a message channel for the specified host/port.

Specified by:
createMessageChannel in class MessageProcessor
Returns:
New MessageChannel for this processor.
Throws:
IOException

createMessageChannel

public MessageChannel createMessageChannel(InetAddress host,
                                           int port)
                                    throws IOException
Description copied from class: MessageProcessor
Create a message channel for the specified host/port.

Specified by:
createMessageChannel in class MessageProcessor
Returns:
New MessageChannel for this processor.
Throws:
IOException

getDefaultTargetPort

public int getDefaultTargetPort()
Default target port for TCP

Specified by:
getDefaultTargetPort in class MessageProcessor

isSecure

public boolean isSecure()
TCP is not a secure protocol.

Specified by:
isSecure in class MessageProcessor


Copyright © 2012. All Rights Reserved.