BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 10-10-2007, 04:52 AM   #1 (permalink)
New Member
 
Join Date: Oct 2007
Model: 8800
PIN: N/A
Carrier: O2 UK
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question Socket connection works on emulator, not on handset

Please Login to Remove!

I have created a socket application based on the sample SocketDemo included with the BlackBerry Java Development Environment.

When I run the application on the simulator, it connects to my socket server and sends data without any issues.

When I run the application on my BlackBerry 8800, the thread handling the connection sticks on the following line:

connection = (SocketConnection)Connector.open( "socket://IP:PORT;deviceside=true");

I have experimented with changing deviceside to false with no affect.

I have ensured that the application is allowed to make connections in the security settings.

Other thread posts suggest socket problems can be related to the network provider, so I put my SIM into an XDAII and ran a .NET compact framework application that connects to the same IP and port number that I am trying on the BlackBerry. This works without any issues.

I have also populated the APN settings within the advanced options on the BlackBerry, but this also seems to have no affect.

I am new to BlackBerry's and so am still finding out about the concepts of BES and MDS, but as far as I understand, as I have BlackBerry 4 and I can browse the web / use instant messaging etc. I should be able to raise a socket connection?

Any help on this much appreciated, I am definately stuck!
Offline  
Old 11-09-2007, 06:26 AM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Oct 2007
Model: 8700
PIN: N/A
Carrier: vodafone
Posts: 37
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi gjw81,

I'm in pretty much the exact situation you are in, except that I'm using an HttpConnector instead of a SocketConnector.

I'm looking in to it, and will let you know as soon as I've got an answer!

Hopefully get back to you soon.

Tig*
Offline  
Old 11-09-2007, 09:21 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Oct 2007
Model: 8700
PIN: N/A
Carrier: vodafone
Posts: 37
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Check APN

Hi,

Ok, what I'm going the solution I have found applies to the HttpConnection, but I cannot say for certain how it works. This may annoy you, as its pretty much what everyone says... but here goes.

I've several different connection classes, and I had to make sure that in each one, i've changed my url to include the:

Connection.open(url + ";deviceside=true"... other args if required);

Initially, my testing of this didnt seem to work. I had to change my APN settings. On the forums alone, there were several different APN settings written down, and as I had come to a dead end, I cycled through each of the various apn settings, and tested until I found one that worked.

The one for me was APN: internal with a password and username of web. I'm on vodafone UK.

Hope switching the APN gives you some joy, i'm sure it will work with a little tweaking.

Regards,

Tig*
Offline  
Old 11-19-2007, 04:38 AM   #4 (permalink)
New Member
 
Join Date: Oct 2007
Model: 8800
PIN: N/A
Carrier: O2 UK
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the reply Tigmeister.

Yes, the APN was the answer for me as well, although changing it in the BlackBerry settings had no effect for me.

To get it to work, I had to include the APN in the call to Connector.Open, as follows:

Connector.open( "socket://IP:PORT;deviceside=true;apn=mobile.o2.co.uk")

Once I did this, all was well.
Offline  
Old 12-04-2007, 11:31 AM   #5 (permalink)
Knows Where the Search Button Is
 
Join Date: Dec 2007
Model: 8800
PIN: N/A
Carrier: vodafone
Posts: 21
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi. i too am having this problem. where do i change the APN settings in the device? thanks
Offline  
Old 12-05-2007, 04:07 AM   #6 (permalink)
Knows Where the Search Button Is
 
Join Date: Dec 2007
Model: 8800
PIN: N/A
Carrier: vodafone
Posts: 21
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

anybody know how i can change the apn settings on a device? thanks in advance and hope someone can assist me in this problem
Offline  
Old 04-30-2008, 01:14 AM   #7 (permalink)
New Member
 
Join Date: Apr 2008
Model: 8670
PIN: N/A
Carrier: Sprint
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Socket Connection Problem

Hi,

I doing some application using Blackberry JDE. I am unable to create Socket connection to make a server connection from client and server.

Here is the sample code.

ConnectionManager connMGR = new ConnectionManager(URL);
StreamConnection conn = connMGR.getConnection();
daOut = connMGR.getDataOutputStream();

I am unable to make socket connection using this and my MDS is also on.

Kindly let me know if any one done with this.

Thanks,
Bala.
Offline  
Old 05-15-2008, 02:03 PM   #8 (permalink)
New Member
 
Join Date: Apr 2008
Model: 8120
PIN: N/A
Carrier: rogers
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default ServerSocket no response

Hi,
I am newer of blackberry and I am trying to run up a servers ocket port on simulator 8210 and trying to connect it from a Java application side with new socket("IP",1234), on Java application side, I can get the remote Server Ip address and port number, but stop on read from inputstream, on Simulator(Server) side, there is no any response at all, code is: ServerSocketConnection scn = (ServerSocketConnection) Connector.open("socket://:1234;deviceside=true); scs = (SocketConnection) scn.acceptAndOpen(); it stop on scn.acceptAndOpen(); wont go further step. Can anybody help me this? what is wrong? do I need to set any others? I appreciate very much.

Last edited by Larry Peng : 05-15-2008 at 02:17 PM.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.