Source Code : Finger Socket
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
Finger Socket
import java.io.DataInputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.net.Socket;
public class finger {
public final static int port = 79;
public static void main(String[] args) {
String hostname;
Socket theSocket;
DataInputStream theFingerStream;
PrintStream ps;
try {
hostname = args[0];
}
catch (Exception e) {
hostname = "localhost";
}
try {
theSocket = new Socket(hostname, port, true);
ps = new PrintStream(theSocket.getOutputStream());
for (int i = 1; i < args.length; i++) ps.print(args[i] + " ");
ps.print("
");
theFingerStream = new DataInputStream(theSocket.getInputStream());
String s;
while ((s = theFingerStream.readLine()) != null) {
System.out.println(s);
}
}
catch (IOException e) {
System.err.println(e);
}
}
}
Thank with us