The Artima Developer Community
Sponsored Link

Java Answers Forum
how to change HttpURLConnection to socket connection

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
enver eroglu

Posts: 1
Nickname: enverer
Registered: Jun, 2005

how to change HttpURLConnection to socket connection Posted: Jun 23, 2005 8:31 AM
Reply to this message Reply
Advertisement
hello i have a problem about a socket connection can you help me


i want to change HttpURLConnection connection to socket connection

here is


java.net.URL url = new java.net.URL("http://64.74.75.74/approot/webapp/ZOR/bare");
connection = new sun.net.www.protocol.http.HttpURLConnection(url, " ", 0);
connection.setRequestMethod("POST");
connection.setDoInput(true);
connectio n.setDoOutput(true);
connection.setUseCaches(false);
java.io.ObjectOutputStream out = new java.io.ObjectOutputStream(connection.getOutputStream());
out.writeObject(getTe xtFieldGiden().getText());
out.flush();
out.close();

return (String) (new java.io.ObjectInputStream(connection.getInputStream()).readObject());



how can i change it to
socket connection

thank you very much

Topic: File Writer - about char oriented streams Previous Topic   Next Topic Topic: Problem in

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use