Quote:
|
Originariamente inviato da sblantipodi
salve,
Codice:
SocketConnection client = (SocketConnection) Connector.open("socket://dpsoftware.org:80");
InputStream is = client.openInputStream();
OutputStream os = client.openOutputStream();
// send something to server
os.write("GET / HTTP/1.0\n\n".getBytes());
// read server response
int c = 0;
int val=0;
int cont=0;
String upd = "";
while((c = is.read()) != -1) {
// do something with the response
upd += (char) c;
}
System.out.print(upd);
// close streams and connection
is.close();
os.close();
client.close();
QUESTA SOCKET al posto di restituire l'index.html del mio dominio, restituisce l'index.html del mio registrar/hoster
Devo arrabbiarmi? O posso risolvere la cosa?
|
Sicuro che questo sia giusto?
Codice:
Connector.open("socket://dpsoftware.org:80");