×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    6

    ServerSocket DataInput/OutputStream not working on s60 emulator

    Hi

    I am developing a client server app for probably a Nokia s60 device using serversocket connections. My code works on SE W950i emulator, it works on netbeans' default Sun emulator and it works on s40 emulator. But it does not work on s60 3rd ed fp1 emulator. Is there some known issue with serversocket or datastreams on the s60 emulator ?

    thanks in advance.


    E.G. Code

    Server side...

    server = new ServerSocket( 5000, MAX_CONNECTIONS );
    ...
    client = server.accept();
    ...
    input = new DataInputStream( client.getInputStream() );
    output = new DataOutputStream( client.getOutputStream() );

    // Hangs here
    String s = input.readUTF();

    client side...
    sConn = (SocketConnection) Connector.open("socket://localhost:5000");

    input = sConn.openDataInputStream();
    output = sConn.openDataOutputStream();
    ....
    // passes this without error
    output.writeUTF("LoadRegDB");

    The connection is accepted on the server but the datastream is not being read/passed between client and server for some reason.

    any ideas ?

  2. #2
    Registered User
    Join Date
    Jun 2006
    Posts
    6

    Re: ServerSocket DataInput/OutputStream not working on s60 emulator

    Further info... I downloaded/installed and tried the S60 2nd FP3 emulator/SDK and received the following error:

    Connection failed
    java.io.IOException: SymbianOS error = -34 : System:\nSystem error.
    - com.symbian.util.NativeError.checkIO(), bci=17
    - com.symbian.gcf.ConnectionEndPoint.checkError(), bci=19
    - com.symbian.gcf.ConnectionEndPoint.open(), bci=133
    - com.symbian.midp.io.protocol.socket.Protocol.openConnection(), bci=127
    - com.symbian.gcf.ProtocolBase.openConnection(), bci=159
    - com.symbian.gcf.GCFConnector.open(), bci=197
    - javax.microedition.io.Connector.open(), bci=4
    - javax.microedition.io.Connector.open(), bci=3
    - javax.microedition.io.Connector.open(), bci=2
    - ParkMobile.ParkMobileMidlet.initialize(), bci=13
    - ParkMobile.ParkMobileMidlet.startApp(), bci=15
    - javax.microedition.midlet.MIDletInvoker.invokeStartApp(), bci=1
    - com.symbian.midp.runtime.MIDletScheduler.startMIDlet(), bci=26
    - com.symbian.midp.runtime.MIDletScheduler.run(), bci=14

  3. #3
    Registered User
    Join Date
    Sep 2007
    Location
    Bangalore
    Posts
    868

    Re: ServerSocket DataInput/OutputStream not working on s60 emulator

    Hi ,
    I think you have to configure your internet connection in your S60 Emulator. In the emulator are you able to browse any sites through your S60 inbuilt browser. check that first.

  4. #4
    Registered User
    Join Date
    Jun 2006
    Posts
    6

    Re: ServerSocket DataInput/OutputStream not working on s60 emulator

    My s60 emulator is able to connect to the internet.
    Also the serversocket is connecting both locally and remotely to a server but then the datainputstream and dataoutputstream is not working, it is sending the data but the server side is not receiving it. On all other emulators I have including s40 it is working.

    I wonder if anyone else can help or has seen this. I guess I can try other stream types or an http connection and we may get an actual phone to test with - on the other hand may we switch Vendors at this rate ! This is valid Java code so should work out of the box. All seems a little bit flaky to be honest !

    thanks

  5. #5
    Registered User
    Join Date
    Jun 2006
    Posts
    6

    Re: ServerSocket DataInput/OutputStream not working on s60 emulator

    In case anyone else checks this thread.

    This is now working - the key element being the need to flush
    output stream after writing to it from the s60 side.

Similar Threads

  1. S60 emulator performance and single IMG file
    By chall3ng3r in forum Tools and SDK Feedback (Closed)
    Replies: 0
    Last Post: 2008-02-18, 23:22
  2. S60 3rd emulator does not recognize security domain settings
    By neil.young in forum Mobile Java Tools & SDKs
    Replies: 3
    Last Post: 2008-02-15, 23:13
  3. S60 SDK error, Failed to launch the emulator
    By alikattan in forum Mobile Java Tools & SDKs
    Replies: 6
    Last Post: 2007-11-13, 08:38
  4. sync4j sync with the S60 emulator
    By vtulai in forum OMA DM/DS/CP
    Replies: 4
    Last Post: 2007-05-11, 06:12
  5. What is going on with Vibration on S60?
    By amd_rikus in forum Mobile Java General
    Replies: 3
    Last Post: 2006-06-16, 00:29

Posting Permissions

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