Advertisement
Josif_tepe

Untitled

Mar 31st, 2022
916
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. import java.io.IOException;
  2. import java.net.ServerSocket;
  3. import java.net.Socket;
  4.  
  5. public class Server {
  6.     public static void main(String[] args) {
  7.         try {
  8.             System.out.println("Cekam nekoj da se vkluci!");
  9.             ServerSocket serverSocket = new ServerSocket(1234);
  10.             Socket socket = serverSocket.accept();
  11.             System.out.println("Konekcijata e uspesna");
  12.         }
  13.         catch (IOException e) {
  14.             e.printStackTrace();
  15.         }
  16.     }
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement