Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Contributor
carlos_navento
Posts: 2
Registered: ‎04-09-2012
My Device: Playbook
Accepted Solution

Problem connecting to server

Hello

 

I'm, tryint to connecto to a server and I'm using the function getaddrinfo() but it fails and the error message I get is servname not supported for ai_socktype.

 

It's a Qt application that I'm porting and I have the <action>access_internet</action>  permission in the bar file.

 

What can I do to solve it? Thanks in advance.

 

  Carlos

 

New Contributor
carlos_navento
Posts: 2
Registered: ‎04-09-2012
My Device: Playbook

Re: Problem connecting to server

Solved, I should have read the documentation more carefully instead of searching google for the error message.

 

I will put the answer here. I had code (that worked in iOS and PC) that set the addrinfo this way:

 

aiHints.ai_family=AF_INET;

 

for the Playbook the setting that works is the following:

 

aiHints.ai_family=PF_UNSPEC;

aiHints.ai_socktype=SOCK_STREAM;