Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package sa;
- import java.net.*;
- import java.io.*;
- public class Server{
- public static void main(String[] args) throws IOException {
- try{
- ServerSocket ss=new ServerSocket(5432);
- System.out.println("listening mode");
- Socket s=ss.accept();
- System.out.println(("request accepted"));
- OutputStream os=s.getOutputStream();
- InputStream is=s.getInputStream();
- PrintWriter pw=new PrintWriter(os);
- pw.println("hello");
- pw.println("hi");
- pw.flush();
- pw.flush();
- while(true){
- }
- pw.close();
- s.close();
- }
- catch(IOException e)
- {
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement