×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    3

    SocketConnection works only on emulator -.- [N6280]

    As in topic... -.-

    Code is working on emulators (wtk 2.5, nokia series 40 3rd ed), hangs on phone
    (tested on N6280, SE w300i)

    Here is the code:
    Code:
    public class B implements Runnable
    {
    	public A a;
    	private SocketConnection s = null;
    	
    	public B(A a)
    	{
    		this.a = a;
    	}
    	
    	public void run()
    	{
    		if (s!=null) {
        		try {
        			s.close();
        			s = null;
        		}
        		catch (Exception e) {
        			a.println ("E2: "+e);
        		}
        	}
        	try {
        		a.println("   Open try...");
        		s = (SocketConnection) Connector.open("socket://xxx.xxx.xxx.xxx:yyy");
        		a.println("   ...this text will be never printed :S"); // = successfully connected
        		s.close();
        	}
        	catch (Exception e) {
        		a.println ("E1: "+e);
        	}
    	}
    }
    (A = midlet, it opens new thread)

    Is this code ok?
    If yes why i cannot connect? -.-

    (btw. opera mini works on my phone....)

    Thanks in advance for any response.

  2. #2
    Registered User
    Join Date
    Oct 2006
    Posts
    25

    Re: SocketConnection works only on emulator -.- [N6280]

    Is your phone unlocked? As far I know to work with direct socket connections your midlet must be signed or a phone must be unlocked.

  3. #3
    Registered User
    Join Date
    Jan 2007
    Posts
    3

    Re: SocketConnection works only on emulator -.- [N6280]

    hm, already i didnt try signing... but i will ^^
    maybe it will help -.-

    thx mate for response ^^

  4. #4
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: SocketConnection works only on emulator -.- [N6280]

    there is a strong probability that the port you are trying to connect to, and may be even the rough tcp protocol are being blocked by your carrier.

  5. #5
    Registered User
    Join Date
    Oct 2006
    Posts
    25

    Re: SocketConnection works only on emulator -.- [N6280]

    It also depends what internet data plan do you have. T-Mobile, for example, restricts a lot of ports in T-MobileWeb plan. You should have full data plan.

Similar Threads

  1. Why StreamConnection works but SocketConnection - not?
    By NickKovach in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2006-12-21, 03:23
  2. SocketConnection - works only in the emulator :-(
    By peterdickten in forum Mobile Java Networking & Messaging & Security
    Replies: 32
    Last Post: 2006-10-19, 13:29
  3. call works on nokia6680 but not n70 or 3230
    By seacabo in forum Symbian
    Replies: 0
    Last Post: 2006-06-08, 14:15
  4. OTA How does it works
    By David_Kihlström in forum Mobile Java General
    Replies: 1
    Last Post: 2003-10-06, 18:43
  5. MIDP & SocketConnection supported?
    By hwc in forum Mobile Java General
    Replies: 0
    Last Post: 2002-06-26, 15:57

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×