NIST SIP Parser and Stack (v1.2) API

gov.nist.javax.sip.stack
Class IOHandler

java.lang.Object
  |
  +--gov.nist.javax.sip.stack.IOHandler

public class IOHandler
extends Object

Class that is used for forwarding SIP requests.


Constructor Summary
IOHandler()
           
 
Method Summary
static Socket sendBytes(InetAddress inaddr, int contactPort, String transport, byte[] bytes)
          Forward a given request to the address given.
static void sendRequest(AddressImpl addr, String request)
          Forward a given request to the address given.
static void sendRequest(HostPort addr, String transport, String nrequest)
          Forward a given request to the address given.
static void sendRequest(InetAddress inaddr, int contactPort, String transport, String request)
          Forward a given request to the address given.
static void sendRequest(String host, int port, String transport, SIPStack stack, gov.nist.javax.sip.message.SIPMessage message)
          Send a request when you have a host and port string
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOHandler

public IOHandler()
Method Detail

sendRequest

public static void sendRequest(AddressImpl addr,
                               String request)
                        throws IOException
Forward a given request to the address given. The address has information on the type of transport etc. used to talk to it.

Parameters:
addr - is the address to which to send the request to
request - is the request that is being forwarded If the address does not specify a transport, we try UDP first and if this fails, then try TCP.
Throws:
IOException - If the message could not be sent for any reason

sendRequest

public static void sendRequest(HostPort addr,
                               String transport,
                               String nrequest)
                        throws IOException
Forward a given request to the address given. The address has information on the type of transport etc. used to talk to it.

Parameters:
addr - is the address to which to send the request.
transport - is the transport string udp or tcp.
nrequest - is the request that is being forwarded For udp we do a connect and a send as specified in tbe RFC so that an error is returned immediately if the other end is not listening
Throws:
IOException - If the message could not be sent for any reason

sendBytes

public static Socket sendBytes(InetAddress inaddr,
                               int contactPort,
                               String transport,
                               byte[] bytes)
                        throws IOException
Forward a given request to the address given. This caches connections for tcp sends.

Parameters:
inaddr - is the address to which to send the request.
transport - is the transport string udp or tcp.
Throws:
IOException - If the message could not be sent for any reason

sendRequest

public static void sendRequest(InetAddress inaddr,
                               int contactPort,
                               String transport,
                               String request)
                        throws IOException
Forward a given request to the address given. The address has information on the type of transport etc. used to talk to it.

Parameters:
inaddr - is the address to which to send the request.
transport - is the transport string udp or tcp.
Throws:
IOException - If the message could not be sent for any reason

sendRequest

public static void sendRequest(String host,
                               int port,
                               String transport,
                               SIPStack stack,
                               gov.nist.javax.sip.message.SIPMessage message)
                        throws IOException
Send a request when you have a host and port string

Parameters:
host - is the host name/address
port - is the port
stack - is the sipStack from where this message is originating (for logging purposes).
message - is the SIP message that we are forwardiong.
IOException

NIST SIP Parser and Stack (v1.2) API

A product of the NIST/ITL Advanced Networking Technologies Division.
See conditions of use.
Get the latest distribution.
Submit a bug report or feature request.