• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

networking

 
praveen gauravaram
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Very urgent. I would like to know which socket I have to use to connect a frame application(GUI) to the servlet
 
Dorj Galaa
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String ConnectionURL="http://locakhost:80800/servlet/MessageServlet";
URL url1 = new URL(ConnectionURL);
URLConnection urlconnection1 = url1.openConnection();
urlconnection1.setDoInput(true);
urlconnection1.setDoOutput(true);
urlconnection1.setUseCaches(false);
urlconnection1.connect();
DataOutputStream out1 = new DataOutputStream(urlconnection1.getOutputStream());
out1.writeByte(115);
out1.flush();
out1.close();
DataInputStream in1 = new DataInputStream(urlconnection1.getInputStream());
in1.close();
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic