BlackBerryForums.com : Your Number One BlackBerry Community      

»Sponsored Links




Reply
 
LinkBack Thread Tools
  (#1 (permalink)) Old
gjw81 Offline
New Member
 
Posts: 2
Join Date: Oct 2007
Model: 8800
PIN: N/A
Carrier: O2 UK
Question Socket connection works on emulator, not on handset - 10-10-2007, 05:52 AM

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!
   
Reply With Quote
Sponsored Links
Please Login or Register to Remove these Advertisements!

  (#2 (permalink)) Old
Tigmeister Offline
Knows Where the Search Button Is
 
Posts: 37
Join Date: Oct 2007
Model: 8700
PIN: N/A
Carrier: vodafone
Default 11-09-2007, 07:26 AM

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*
   
Reply With Quote
  (#3 (permalink)) Old
Tigmeister Offline
Knows Where the Search Button Is
 
Posts: 37
Join Date: Oct 2007
Model: 8700
PIN: N/A
Carrier: vodafone
Default Check APN - 11-09-2007, 10:21 AM

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*
   
Reply With Quote
  (#4 (permalink)) Old
gjw81 Offline
New Member
 
Posts: 2
Join Date: Oct 2007
Model: 8800
PIN: N/A
Carrier: O2 UK
Default 11-19-2007, 05:38 AM

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.
   
Reply With Quote
  (#5 (permalink)) Old
jonneymendoza Offline
Knows Where the Search Button Is
 
Posts: 21
Join Date: Dec 2007
Model: 8800
PIN: N/A
Carrier: vodafone
Default 12-04-2007, 12:31 PM

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

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

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.
   
Reply With Quote
  (#8 (permalink)) Old
Larry Peng Offline
New Member
 
Posts: 4
Join Date: Apr 2008
Model: 8120
PIN: N/A
Carrier: rogers
Default ServerSocket no response - 05-15-2008, 03:03 PM

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 03:17 PM.
   
Reply With Quote
Reply


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-2008 BlackBerryNews.com, BlackBerryFAQ.com, BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of Research In Motion Limited.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.1