Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with client server programming

 
Santhana Lakshmi.S
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic