Пример #1
0
  /**
   * Constructor - takes a datagram packet and a stack structure Extracts the address of the other
   * from the datagram packet and stashes away the pointer to the passed stack structure.
   *
   * @param stack is the shared SIPStack structure
   * @param messageProcessor is the creating message processor.
   */
  protected UDPMessageChannel(SIPTransactionStack stack, UDPMessageProcessor messageProcessor) {
    super.messageProcessor = messageProcessor;
    this.sipStack = stack;

    Thread mythread = new Thread(this);

    this.myAddress = messageProcessor.getIpAddress().getHostAddress();
    this.myPort = messageProcessor.getPort();

    mythread.setName("UDPMessageChannelThread");
    mythread.setDaemon(true);
    mythread.start();
  }
Пример #2
0
  /**
   * Constructor. We create one of these in order to process an incoming message.
   *
   * @param stack is the SIP sipStack.
   * @param messageProcessor is the creating message processor.
   * @param packet is the incoming datagram packet.
   */
  protected UDPMessageChannel(
      SIPTransactionStack stack, UDPMessageProcessor messageProcessor, DatagramPacket packet) {

    this.incomingPacket = packet;
    super.messageProcessor = messageProcessor;
    this.sipStack = stack;

    this.myAddress = messageProcessor.getIpAddress().getHostAddress();
    this.myPort = messageProcessor.getPort();
    Thread mythread = new Thread(this);
    mythread.setDaemon(true);

    mythread.start();
  }