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...
-
import java.net.*; import java.io.*; public class client{ public static void main(String a[]){ try{ Socket w=new Socket("localhost...
-
Elements are processed in the First In First Out (FIFO) manner Those Queues that are present in the util package are known as Unbounded Qu...
-
package datastructures.linear ; public class TreeFromTheScratch { public static void main (String[] args) { TreeImpl tree = ne...
No comments:
Post a Comment