SHARE
TWEET

Untitled

a guest Sep 26th, 2012 744 Never
  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.     }
RAW Paste Data
Top