I've set some time slices to my stack and it works.
----- Original Message ----
From: Ryan Kereliuk <ryker@xxxxxxxxx>
To: Tuan Viet Nguyen <ntvietv@xxxxxxxxx>
Cc: resiprocate-devel@xxxxxxxxxxxxxxxxxxxx
Sent: Wednesday, June 13, 2007 3:13:45 PM
Subject: Re: [reSIProcate] Problem in receiving message
Make sure you've written a valid test program! Have a look in
resip/stack/test for lots of examples. For example, I don't see you
giving the stack any time slices so I wouldn't expect your code to work.
Thanks,
-Ryan
On
2007-06-13 at 09h07, Tuan Viet Nguyen wrote:
>
> SipStack stack;
> stack.addTransport(UDP, 8082);
>
> if (stack.isMyPort(8082))
> {
> // show "Port 8082";
> }else
> {
> // show "Not 8082";
> }
>
> while (true)
> {
> if (stack.hasMessage())
> {
> //Show "We have got a message!";
>
> SipMessage *msg = stack.receive();
>
> if
(msg)
> {
> // Show msg->getSource().getPort();
> }
> }
> }
>
> When executing, my program listen on the port 8082 (verified with netstat), I used X-Lite to send some REGISTER to this port but the application does not receive anything. Here's the output:
>
> INFO | 20070613-180555.767 | | | RESIP:TRANSPORT | 0 | 3073754832 | UdpTransport.cxx:42 | Creating UDP transport host= port=8082 ipv4=1
> Port 8082
>
> Could you give me some advice?