hello tehre,
i want to get a date from a webserver. now i have tried this one here:
PHP Code:
public static void setDate() {
SocketConnection sc = null;
InputStream is = null;
OutputStream os = null;
try {
sc = (SocketConnection)Connector.open("socket://time-A.timefreq.bldrdoc.gov:13;deviceside=false",Connector.READ_WRITE);
sc.setSocketOption(SocketConnection.KEEPALIVE, 1);
sc.setSocketOption(SocketConnection.LINGER, 5);
is = sc.openInputStream();
os = sc.openOutputStream();
int ch = 0;
StringBuffer sb = new StringBuffer();
do {
ch = (byte)is.read();
sb.append((char) ch);
} while (is.available() > 0);
String erg = sb.toString();
System.out.println(erg);
} catch (Exception ex) {System.out.println("Error 0x28: "+ex.toString());}
}
and that works fine.
but what is if the port 13 is blocked? so is therea way to get date from a webserver over port 80?
thanks hibbert