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

Java Development

Reply
Developer
Posts: 192
Registered: ‎01-12-2010
My Device: Bold
My Carrier: ZAIN

Socket Server

Hi Guys,

Just a question? .

 

I am following the SocketDemo example in the samples been able to execute and it works fine.

 

in that example the listening socket is on the PC and the requestor is on the blackberry.

 

Is it possible to have the listening socket on the blackberry so that i can send requests from another socket or application.

 

Can anyone please provide me some help or point in right direction

 

any help is appreciated

 

Many thanks

nadir firfire

 

Developer
Posts: 1,055
Registered: ‎01-25-2009
My Device: BlackBerry Bold 9650/BlackBerry Torch 9800

Re: Socket Server

While you may be able to run a socket server on the BlackBerry, besides WIFI (and maybe BES but not sure) connections, the BlackBerry itself does not have its own IP address for you to target it. Even over WIFI, I'm not sure that you'd be able to access this server from another BlackBerry or another machine since I haven't tried that.

Jerome Carty - Follow jcarty on Twitter@jcarty | #webworks-dev / #BlackberryDev on irc.freenode.net | My Apps
Click "Accept as Solution" if post solved your original issue.. Give like/thumbs up if you feel post is helpful
Developer
Posts: 192
Registered: ‎01-12-2010
My Device: Bold
My Carrier: ZAIN

Re: Socket Server

Hi,

thanks for your reply your question raised many concerns.

 

i  think the best way would be to have a listening socket on the computer and the recieving socket running continously on blackberry

 

rgds

Nadir

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Socket Server

It is possible to open an equivalent of a TCP or UDP server socket.

 

The typical catches are:

 

1. Typically, the handheld is connected to a private network inside the carrier network infrastructure. This network has NATed and firewalled access to the Internet. However, since the handheld has an internal non-routable IP address and since it's behind NAT + firewall, it's not easy to receive incoming TCP connections from the Internet or UDP datagrams from sources to which they haven't been sent first by the handheld. This also applies in the case of Wi-Fi, where the handheld enters the IP network through a private network with NATed + firewalled Internet access. However, the case of Wi-Fi is made easier because it's easier to place another handheld on the same private network in order to connect to the handheld running the server.

 

Note that some cellular accounts are configured to have non-NATed access to the Internet. Moreover, access from the Internet might not be an issue if you are developing an application for a private APN.

 

2. InputStreams from incoming TCP connections might not return all the data (on some handheld software) until the streams are closed.

Developer
Posts: 192
Registered: ‎01-12-2010
My Device: Bold
My Carrier: ZAIN

Re: Socket Server

Hi,

i think your post clarifies lot of questions.

Again i have small concern since we are able to assign IP to the handheld on the router by its MAC address i think there might be a possibility.

 

rgds

Nadir

Developer
Posts: 192
Registered: ‎01-12-2010
My Device: Bold
My Carrier: ZAIN

Re: Socket Server

further to this post.

I have found a way to assign IP to BB device..

then if i assign a IP on the device can i make the device as a server which will listen to incoming connections

 

rgds

nadir firfire

New Contributor
Posts: 3
Registered: ‎07-19-2010
My Device: Not Specified

Re: Socket Server

[ Edited ]

hi ,I have the same problem, you have the solution for it? Can you share a little bit?

 

EDIT: Personal Information Removed - Info such as e-mails are prohibited for security purposes

Highlighted
Developer
Posts: 192
Registered: ‎01-12-2010
My Device: Bold
My Carrier: ZAIN

Re: Socket Server

ok

i will email you the full source code