Results 1 to 3 of 3
Thread: program is very slow
- 02-14-2012, 10:34 PM #1
Member
- Join Date
- Feb 2012
- Posts
- 1
- Rep Power
- 0
program is very slow
i hava this code it works but it runs very slow
Java Code:import java.net.Socket; import java.io.IOException; import java.io.*; public class portscan { public static void main(String[] args) throws IOException { int i = 0; String remote = "localhost"; FileWriter fstream = new FileWriter("hello.txt"); BufferedWriter out = new BufferedWriter(fstream); do { try { Socket s = new Socket(remote,i); out.write("Server is listening on port " + i+ " of " + remote ); out.newLine(); s.close(); } catch (IOException ex) { out.write("Server is not listening on port " + i+ " of " + remote); out.newLine(); } i++; } while(i <= 55000); out.close(); }}
- 02-14-2012, 11:03 PM #2
Re: program is very slow
Moved from New to Java
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 02-15-2012, 12:36 AM #3
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,609
- Rep Power
- 5
Similar Threads
-
Slow applet
By robs in forum Java AppletsReplies: 20Last Post: 02-28-2011, 03:15 PM -
why is it so slow? need to optimize it?
By skarosg3 in forum Advanced JavaReplies: 15Last Post: 10-08-2010, 08:54 AM -
my program is running bit slow!!
By Arn00p in forum AWT / SwingReplies: 18Last Post: 05-05-2010, 04:14 PM -
slow iterator
By jamborta in forum New To JavaReplies: 9Last Post: 05-25-2009, 08:04 AM -
is IntelliJ is slow in IDE ??
By adusumalli in forum IntelliJ IDEAReplies: 3Last Post: 12-16-2008, 05:44 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks