Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 26th, 2012  |  syntax: None  |  size: 0.75 KB  |  views: 277  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import java.io.*;
  2. import java.net.*;
  3.  
  4. public class SOK_1_CLIENT
  5. {
  6.  
  7.         public static void main(String[] args) throws Exception
  8.         {
  9.             SOK_1_CLIENT CLIENT = new SOK_1_CLIENT();
  10.             CLIENT.run();
  11.         }
  12.        
  13.         public void run() throws Exception
  14.         {
  15.             Socket SOCK = new Socket("192.159.104.19",444);
  16.             PrintStream PS = new PrintStream(SOCK.getOutputStream());
  17.             PS.println("Hello to server from client");
  18.            
  19.             InputStreamReader IR = new InputStreamReader(SOCK.getInputStream());
  20.             BufferedReader BR = new BufferedReader(IR);
  21.            
  22.             String MESSAGE = BR.readLine();
  23.             System.out.println(MESSAGE);
  24.         }
  25.     }
clone this paste RAW Paste Data