Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - UDP communication : (19 Items)
   
UDP communication  
Hi,

I'm testing an example application of the library "udt". The code of this example works with Linux and Windows.

Under QNX6.4.1 I got the following error message:

> bind: Connection setup failure: unable to create/configure UDP socket:
> No buffer space available.

Is UDP not supported ??

The code sequence is: 

 int main(int argc, char* argv[])
{
   if ((1 != argc) && ((2 != argc) || (0 == atoi(argv[1]))))
   {
      cout << "usage: appserver [server_port]" << endl;
      return 0;
   }

   // use this function to initialize the UDT library
   UDT::startup();

   addrinfo hints;
   addrinfo* res;

   memset(&hints, 0, sizeof(struct addrinfo));

   hints.ai_flags = AI_PASSIVE;
   hints.ai_family = AF_INET;
   hints.ai_socktype = SOCK_STREAM;
   //hints.ai_socktype = SOCK_DGRAM;

   string service("9000");
   if (2 == argc)
      service = argv[1];

   if (0 != getaddrinfo(NULL, service.c_str(), &hints, &res))
   {
      cout << "illegal port number or port is busy.\n" << endl;
      return 0;
   }

   UDTSOCKET serv = UDT::socket(res->ai_family, res->ai_socktype, res->ai_protocol);


   // UDT Options
   //UDT::setsockopt(serv, 0, UDT_CC, new CCCFactory<CUDPBlast>, sizeof(CCCFactory<CUDPBlast>));
   //UDT::setsockopt(serv, 0, UDT_MSS, new int(9000), sizeof(int));
   //UDT::setsockopt(serv, 0, UDT_RCVBUF, new int(10000000), sizeof(int));
   //UDT::setsockopt(serv, 0, UDP_RCVBUF, new int(10000000), sizeof(int));


   if (UDT::ERROR == UDT::bind(serv, res->ai_addr, res->ai_addrlen))
   {
      cout << "bind: " << UDT::getlasterror().getErrorMessage() << endl;
      return 0;
   }

   freeaddrinfo(res);
.....  a.s.o

--Armin


Re: UDT communication  
Yes, UDP is supported :-)

I am not familiar with this library and since the source code only has 
the calls into what I assume is the library (and doesn't contain the 
socket API calls) I'm afraid I can't point you at what is going on. I 
have to assume therefore that it's doing some Linux-ism or something 
else which won't fly on BSD style systems. Have you tried this on BSD?

/P

>> bind: Connection setup failure: unable to create/configure UDP socket:
>> No buffer space available.

This is probably not the error coming from the QNX socket library, 
sounds like something internal to UDT.

>     // use this function to initialize the UDT library
>     UDT::startup();
>     UDTSOCKET serv = UDT::socket(res->ai_family, res->ai_socktype, res->ai_protocol);
>     if (UDT::ERROR == UDT::bind(serv, res->ai_addr, res->ai_addrlen))

I have no idea what goes on inside ::startup, ::socket, ::bind methods 
so cant' really say what (may) have gone wrong...
RE: UDT communication  
I`m using the Poco library that implement UPD objects and it worked right out of the box.


> -----Original Message-----
> From: Patrik Lahti [mailto:community-noreply@qnx.com]
> Sent: Monday, May 17, 2010 9:29 AM
> To: general-networking
> Subject: Re: UDT communication
> 
> Yes, UDP is supported :-)
> 
> I am not familiar with this library and since the source code only has
> the calls into what I assume is the library (and doesn't contain the
> socket API calls) I'm afraid I can't point you at what is going on. I
> have to assume therefore that it's doing some Linux-ism or something
> else which won't fly on BSD style systems. Have you tried this on BSD?
> 
> /P
> 
> >> bind: Connection setup failure: unable to create/configure UDP
> socket:
> >> No buffer space available.
> 
> This is probably not the error coming from the QNX socket library,
> sounds like something internal to UDT.
> 
> >     // use this function to initialize the UDT library
> >     UDT::startup();
> >     UDTSOCKET serv = UDT::socket(res->ai_family, res->ai_socktype,
> res->ai_protocol);
> >     if (UDT::ERROR == UDT::bind(serv, res->ai_addr, res->ai_addrlen))
> 
> I have no idea what goes on inside ::startup, ::socket, ::bind methods
> so cant' really say what (may) have gone wrong...
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post54843
> 
Re: RE: UDT communication  
> 
> I`m using the Poco library that implement UPD objects and it worked right out 
> of the box.

Also the UDT library works out of the box ... but only for Linux and Windows.
The UDT lib is C++ based. What about the Poco lib ?

The ported code of the UDT lib is available at:
 http://community.qnx.com/sf/sfmain/do/downloadAttachment/projects.toolchain/discussion.core_development_tools.topc13742
/post54800?id=atch7679

It compiles as out of the box ... but doesn't work as out of the box.

-Armin

RE: RE: UDT communication  

> -----Original Message-----
> From: Armin Steinhoff [mailto:community-noreply@qnx.com]
> Sent: Monday, May 17, 2010 3:58 PM
> To: general-networking
> Subject: Re: RE: UDT communication
> 
> >
> > I`m using the Poco library that implement UPD objects and it worked
> right out
> > of the box.
> 
> Also the UDT library works out of the box ... but only for Linux and
> Windows.
> The UDT lib is C++ based. What about the Poco lib ?

Yes it`s a C++ library very nice, it contains a lot more then UDP, it has TCP, HTTPD, XML and lots of other goodies: 
http://pocoproject.org/.  I rarely stumble upon code that I look on and say I which I could program like this.  Poco is 
one of them.  I don`t understand why it`s not as popular.

I compiles and works fine ;-)  I`m using 4 of the 5 freely available module, Foundation, Net, XML, Zip.


> 
> The ported code of the UDT lib is available at:
> 
> http://community.qnx.com/sf/sfmain/do/downloadAttachment/projects.toolc
> hain/discussion.core_development_tools.topc13742/post54800?id=atch7679
> 
> It compiles as out of the box ... but doesn't work as out of the box.
> 
> -Armin
> 
> 
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post54893
> 
Re: UDT communication  
Patrik,

just a statement to the "-ism".


Patrik Lahti wrote:
> Yes, UDP is supported :-)
>
> I am not familiar with this library and since the source code only has 
> the calls into what I assume is the library (and doesn't contain the 
> socket API calls) I'm afraid I can't point you at what is going on. I 
> have to assume therefore that it's doing some Linux-ism 

Your approach of thinking is "QNX is right ... the rest of the world has 
a failure".

No  ... the problem are QNX-ism.
It's still a pain to port a piece of C++ based software to QNX.

As a reality check ... try to recompile the ROOT system.  ( 
http://root.cern.ch )
And then ask why they are not using QNX ...

> or something 
> else which won't fly on BSD style systems. Have you tried this on BSD?
>   

Why should it work with BSD?
On QNX you can recompile just 3000 of 9000 BSD packages. The reasons are 
BSD-ism ??

Cheers

--Armin
RE: UDT communication  
But QNX *is* right :-)
Just kidding...
/P
Attachment: Text winmail.dat 2.03 KB
Re: UDP communication  
Can you give a compiling example using this
library?

Thanks,

-seanb
Re: UDP communication  
Sean,

the ported lib is available at: 
http://community.qnx.com/sf/sfmain/do/downloadAttachment/projects.toolchain/discussion.core_development_tools.topc13742/
post54800?id=atch7679.

There is still for linking the libstdc++ to remove ...

Regards

--Armin


Sean Boudreau wrote:
> Can you give a compiling example using this
> library?
>
> Thanks,
>
> -seanb
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post54962
>
>
>   
Re: UDP communication  
On Tue, May 18, 2010 at 11:39:24AM -0400, Armin Steinhoff wrote:
> Sean,
> 
> the ported lib is available at: 
> http://community.qnx.com/sf/sfmain/do/downloadAttachment/projects.toolchain/discussion.core_development_tools.
topc13742/post54800?id=atch7679.
> 
> There is still for linking the libstdc++ to remove ...
> 

I downloaded it, and built it.  Now how do I reproduce your issue?

Thanks,

-seanb
Re: UDP communication  
Sean Boudreau wrote:
> On Tue, May 18, 2010 at 11:39:24AM -0400, Armin Steinhoff wrote:
>   
>> Sean,
>>
>> the ported lib is available at: 
>> http://community.qnx.com/sf/sfmain/do/downloadAttachment/projects.toolchain/discussion.core_development_tools.
topc13742/post54800?id=atch7679.
>>
>> There is still for linking the libstdc++ to remove ...
>>
>>     
>
> I downloaded it, and built it.  Now how do I reproduce your issue?
>   

In the directory app is located the "appserver". This example terminates 
with an strange error message.

Regards

--Armin


Re: UDP communication  
> 
> In the directory app is located the "appserver". This example terminates 
> with an strange error message.

Please see the attached diff.  You might want to go
through the other ifdefs.

Regards,

-seanb
Attachment: Text diff 521 bytes
Re: UDP communication  
> > 
> > In the directory app is located the "appserver". This example terminates 
> > with an strange error message.
> 
> Please see the attached diff.  You might want to go
> through the other ifdefs.

And please send them back to the UDT people.

-seanb
Attachment: Text diff 521 bytes
Re: UDP communication  
Sean,

I have checked all other idefs. The os spec in the Makefiles was also 
not fully correct ... I changed it to UNIX.
After  recompiling and linking against the shared lib of udt ... 
"appserver" terminaties with the same problem as before.

But the applications "appserver" and "appclients" are working after 
linking against the _static_ library of udt!

IMHO ... this is a QNX-ism of QCC.  Should  I send this problem back to 
the compiler/linker guys  ?

Regards

--Armin



Sean Boudreau wrote:
>>> In the directory app is located the "appserver". This example terminates 
>>> with an strange error message.
>>>       
>> Please see the attached diff.  You might want to go
>> through the other ifdefs.
>>     
>
> And please send them back to the UDT people.
>
> -seanb
>
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post55026
>   

Re: UDP communication  
On Wed, May 19, 2010 at 09:16:02AM -0400, Armin Steinhoff wrote:
> 
> Sean,
> 
> I have checked all other idefs. The os spec in the Makefiles was also 
> not fully correct ... I changed it to UNIX.
> After  recompiling and linking against the shared lib of udt ... 
> "appserver" terminaties with the same problem as before.
> 
> But the applications "appserver" and "appclients" are working after 
> linking against the _static_ library of udt!
> 
> IMHO ... this is a QNX-ism of QCC.  Should  I send this problem back to 
> the compiler/linker guys  ?
> 

Did you get rid of the -lstdc++ ?  With that change appserver
is working for me against the shared lib.

# pidin -p appserver me
     pid tid name               prio STATE            code  data        stack
  909350   1 ./appserver         10o CONDVAR           24K  168K   24K(516K)*
  909350   2 ./appserver         10o CONDVAR           24K  168K  4096(132K) 
  909350   3 ./appserver         10o CONDVAR           24K  168K  4096(132K) 
  909350   4 ./appserver         10o REPLY             24K  168K  4096(132K) 
            libc.so.3          @b0300000             488K   16K
            libudt.so          @b8200000             236K  8192
            libcpp.so.4        @b823d000             376K   36K
            libm.so.2          @b82a4000             180K   24K
            libsocket.so.3     @b82d7000             164K   28K
Re: UDP communication  
Sean,

I removed -lstdc++, -lcpp and -lcxa  because all compilation was done 
with QCC.
I'm using qnx 6.4.1 ...

--Armin


Sean Boudreau wrote:
> On Wed, May 19, 2010 at 09:16:02AM -0400, Armin Steinhoff wrote:
>   
>> Sean,
>>
>> I have checked all other idefs. The os spec in the Makefiles was also 
>> not fully correct ... I changed it to UNIX.
>> After  recompiling and linking against the shared lib of udt ... 
>> "appserver" terminaties with the same problem as before.
>>
>> But the applications "appserver" and "appclients" are working after 
>> linking against the _static_ library of udt!
>>
>> IMHO ... this is a QNX-ism of QCC.  Should  I send this problem back to 
>> the compiler/linker guys  ?
>>
>>     
>
> Did you get rid of the -lstdc++ ?  With that change appserver
> is working for me against the shared lib.
>
> # pidin -p appserver me
>      pid tid name               prio STATE            code  data        stack
>   909350   1 ./appserver         10o CONDVAR           24K  168K   24K(516K)*
>   909350   2 ./appserver         10o CONDVAR           24K  168K  4096(132K) 
>   909350   3 ./appserver         10o CONDVAR           24K  168K  4096(132K) 
>   909350   4 ./appserver         10o REPLY             24K  168K  4096(132K) 
>             libc.so.3          @b0300000             488K   16K
>             libudt.so          @b8200000             236K  8192
>             libcpp.so.4        @b823d000             376K   36K
>             libm.so.2          @b82a4000             180K   24K
>             libsocket.so.3     @b82d7000             164K   28K
>
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post55144
>
>
>   

Re: UDP communication  
> 
> Sean,
> 
> I removed -lstdc++, -lcpp and -lcxa  because all compilation was done 
> with QCC.
> I'm using qnx 6.4.1 ...

and compile /link natively ...

--Armin


> 
> --Armin
> 
> 
> Sean Boudreau wrote:
> > On Wed, May 19, 2010 at 09:16:02AM -0400, Armin Steinhoff wrote:
> >   
> >> Sean,
> >>
> >> I have checked all other idefs. The os spec in the Makefiles was also 
> >> not fully correct ... I changed it to UNIX.
> >> After  recompiling and linking against the shared lib of udt ... 
> >> "appserver" terminaties with the same problem as before.
> >>
> >> But the applications "appserver" and "appclients" are working after 
> >> linking against the _static_ library of udt!
> >>
> >> IMHO ... this is a QNX-ism of QCC.  Should  I send this problem back to 
> >> the compiler/linker guys  ?
> >>
> >>     
> >
> > Did you get rid of the -lstdc++ ?  With that change appserver
> > is working for me against the shared lib.
> >
> > # pidin -p appserver me
> >      pid tid name               prio STATE            code  data        
> stack
> >   909350   1 ./appserver         10o CONDVAR           24K  168K   24K(516K)
> *
> >   909350   2 ./appserver         10o CONDVAR           24K  168K  4096(132K)
>  
> >   909350   3 ./appserver         10o CONDVAR           24K  168K  4096(132K)
>  
> >   909350   4 ./appserver         10o REPLY             24K  168K  4096(132K)
>  
> >             libc.so.3          @b0300000             488K   16K
> >             libudt.so          @b8200000             236K  8192
> >             libcpp.so.4        @b823d000             376K   36K
> >             libm.so.2          @b82a4000             180K   24K
> >             libsocket.so.3     @b82d7000             164K   28K
> >
> >
> >
> >
> > _______________________________________________
> >
> > General
> > http://community.qnx.com/sf/go/post55144
> >
> >
> >   
> 


Re: UDP communication  
On Wed, May 19, 2010 at 12:28:14PM -0400, Armin Steinhoff wrote:
> > 
> > Sean,
> > 
> > I removed -lstdc++, -lcpp and -lcxa  because all compilation was done 
> > with QCC.
> > I'm using qnx 6.4.1 ...
> 
> and compile /link natively ...

Of course, like all packet pushers should :)

I'm on 6.5 but I can't think why that should matter...

-seanb
Re: UDP communication  
Sean Boudreau wrote:
> On Wed, May 19, 2010 at 12:28:14PM -0400, Armin Steinhoff wrote:
>   
>>> Sean,
>>>
>>> I removed -lstdc++, -lcpp and -lcxa  because all compilation was done 
>>> with QCC.
>>> I'm using qnx 6.4.1 ...
>>>       
>> and compile /link natively ...
>>     
>
> Of course, like all packet pushers should :)
>
> I'm on 6.5 but I can't think why that should matter...
>   

Different binaries of compiler/linker ... different 
environments/libraries on QNX6, Linux, Windows ?

I will repeat the test on 6.5 ...

--Armin