Advertisement
Guest User

Untitled

a guest
Jan 26th, 2015
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.81 KB | None | 0 0
  1.    private static void ContinueIM(String ContIP, String FROM, String MESSAGE) {
  2.         new Thread(new Runnable(){
  3.             public void run() {
  4.                 try {
  5.                     String sentence = MESSAGE;
  6.                     BufferedReader inFromUser = new BufferedReader( new InputStreamReader(System.in));
  7.                     Socket clientSocket = new Socket(ContIP, 6789);
  8.                     DataOutputStream outToServer = new DataOutputStream(clientSocket.getOutputStream());
  9.                     outToServer.writeBytes(sentence + "," + FROM);
  10.                     System.out.println("Sent back!");
  11.                     clientSocket.close();
  12.                 } catch (Exception e){
  13.                     System.out.println(e);
  14.                 }
  15.                
  16.             }
  17.  
  18.         }).start();
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement