• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with client server programming

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
In my project,
I created one client porgram in j2me,which will get the request from the browser and send that request to the proxy server and get the response from the proxyserver and send it back to the browser.
Browser<->Myapplication<->proxyserver.

my program is working fine in emulator.after installing my application in the mobile(i tested in Nokia6630 and also N70)the request from the browser in the mobile is not going to the proxyserver.
First, i run the application and then i opened the browser.by that time the connection between the browser and my application is getting established and nothing happens then.
If I close the browser then the request is going to proxyserver.
the following is the code i am using to send the request and getting back the request.

String str = "socket://203.199.200.4:9393";
s = (SocketConnection)Connector.open(str,Connector.READ_WRITE);
/*OutStream to write the request to the proxy server*/
out = s.openOutputStream();
outw = new PrintStream(out);
outw.print(requestHeader);//request from the browser
outw.print("\r\n\r\n");
outw.print("\r\n\r\n");
outw.flush();
/*Inputstream to read the response from the proxy server*/
in = s.openInputStream();
/* writing the response in the browser*/
while((len = in.read(buffer))!= -1) {
os.write(buffer, 0, len);
}

Can anyone help me to make this working in mobile?i am struggling for so long time to do.
thanks a lot.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic