Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1.  
  2. import java.io.IOException;
  3. import java.io.InputStream;
  4. import java.io.OutputStream;
  5. import java.net.Socket;
  6.  
  7. public class Main {
  8.  
  9.     public static void main(String args[]) throws IOException {
  10.        
  11.         Socket s = new Socket("irc.mgts.by", 6667);
  12.         InputStream in = s.getInputStream();
  13.         OutputStream out = s.getOutputStream();
  14.         for (;;) {
  15.             int command = System.in.read();
  16.             int get;
  17.             out.write(command);
  18.             while((get = in.read()) != -1){
  19.                 System.out.print((char)get);
  20.             }
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement