import java.net.*;
import java.io.*;
public class server{
public static void main(String args[])throws IOException{
ServerSocket s=new ServerSocket(1234);
while(true){
Socket s1=s.accept();
DataInputStream is=new DataInputStream(s1.getInputStream());
String sr=new String(is.readUTF());
System.out.println(sr);
DataOutputStream os=new DataOutputStream(s1.getOutputStream());
os.writeUTF("bla bla bla");
os.close();
is.close();
s1.close();
}
}
}
Programming can be fun, and so can cryptography; however, they should not be combined. :p
Search
java socket (sever side)
Subscribe to:
Post Comments (Atom)
Java Interfaces vs. Abstract class
Summary of the similarities and differences between the Interfaces and Abstract class Abstract class Interface Has a constructor Yes No An i...
No comments:
Post a Comment