×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Aug 2010
    Location
    Chennai, India.
    Posts
    176

    Asynchronous socket in j2me

    Experts,

    How can i implement Asynchronously call a method in socket JavaME..? when a socket connection is open? I want to receive a data continuously.

    Is there any method/ code in socket connection in j2me..?

    Thanks,
    kumar

  2. #2
    Regular Contributor
    Join Date
    Aug 2010
    Location
    Chennai, India.
    Posts
    176

    Re: Asynchronous socket in j2me

    anyone help me..?

    I want to receive a data continously when i want to send data to the server. I used InputStream for receiving the data,

    Its show error like
    java.io.IOException: no more input streams available
    at com.sun.midp.io.ConnectionBaseAdapter.openInputStream(+20)
    at socketConnection.socketClient$ServerThread.receiveMethod(+16)
    at socketConnection.socketClient$ServerThread.run(+430)
    Is it possible to receive data bt more than one InputStream, or else there is a method for Asynchronously receive the data..?

    please help me to solve this problem..?

    kumar

  3. #3
    doc.brown
    Guest

    Re: Asynchronous socket in j2me

    Can you give us some sample code to clarify your problem?

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: Asynchronous socket in j2me

    Quote Originally Posted by kumar1234567 View Post
    anyone help me..?

    I want to receive a data continously when i want to send data to the server. I used InputStream for receiving the data,

    Its show error like


    Is it possible to receive data bt more than one InputStream, or else there is a method for Asynchronously receive the data..?

    please help me to solve this problem..?

    kumar
    You need to check isAvailable(), on the input stream and then try to read the no. of bytes that are available on the stream to read.
    Then wait for 500ms or 1sec and then try again, check and read the available bytes from the stream
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  5. #5
    Registered User
    Join Date
    Aug 2013
    Posts
    9

    Re: Asynchronous socket in j2me

    How can I implement asynchronous call to server using http connection. I have used http connection but while running the application the application closed suddenly and throw exception like "Application closed! java-comms:ALLoc: error" . Also checking epocwind.out file logging there is no error I found. I think the application closed because of http connection . Is it right or not?. Can u help me to figure out what's the error .

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,750

    Re: Asynchronous socket in j2me

    As your question seems to be related to a Symbian/S60 emulator, you may want to check if its built-in browser application is able to access the net.

  7. #7
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    686

    Re: Asynchronous socket in j2me

    A reason for an application to be cloased is if there was an unhandled exception that was performed with code running on the main system thread.
    in order to run http connection openning and reading in an asynchronous way you need to run that code in a new thread, but in any case i would also recommend you catch any excpetion that the http connection calls can throw and first log it properly and then try to handle it.

Similar Threads

  1. Replies: 3
    Last Post: 2010-09-09, 08:24
  2. sending message from j2se socket to j2me socket
    By gizyy in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2010-05-10, 07:14
  3. Native Symbian Socket Server & J2ME Socket Client
    By romantr in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2010-04-21, 07:37
  4. socket listen in Asynchronous
    By maoxizhu in forum Symbian
    Replies: 3
    Last Post: 2009-04-29, 07:49
  5. Asynchronous socket service
    By felipebzr in forum Symbian
    Replies: 1
    Last Post: 2007-04-23, 06:14

Posting Permissions

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