×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    1

    If socket and HTTP connection in single midlet..??

    Hi,
    Im facing a problem in my application,which is ,

    I need to connect to Web server ,as some 40 series phone are not supporting HTTP connection , i used sockect connection .

    Now the requirmnt is , 1st i need to try thru http connection , if the phon wont support ,it ll thru IOException ,so ther iam using socket code,

    Now ther problm is both socket n Http connxn is workin fine ,if i use tht in different program, If i integrat both as i mentioned ealier ,Socket is wokin but Http connection is not workin ....

    Any 1 ve any solution for this..??

  2. #2
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    220

    Re: If socket and HTTP connection in single midlet..??

    Hi Vijay,

    In my views you can write a method that returns the input stream irrespective of the HTTP/Socket usage. The method first tries to estabnlish a connection using the HTTP, checks for the response and if the response is HTTP 200, opens the input stream and returns.

    If the HTTP does not works, it creates the Socket connection, opens the input stream and returns.

    Hope this will help You.

    Regards
    Amit

Similar Threads

  1. Socket or HTTP connection over Bluetooth- Nokia N70
    By Hiltarus in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2007-04-12, 14:55
  2. remote host address(of socket and http connection as well)
    By p_joon in forum Mobile Java General
    Replies: 1
    Last Post: 2007-03-05, 07:04
  3. What is differences about HTTP Connnection and socket connection?
    By sarwono in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2006-12-26, 13:06
  4. maintaining 2 way HTTP or socket connection?
    By newmania in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2003-04-12, 03:44
  5. maintaining 2 way HTTP or socket connection??
    By newmania in forum Mobile Java General
    Replies: 3
    Last Post: 2003-04-04, 08:51

Posting Permissions

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