Guest User

Untitled

a guest
Jan 12th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package clienteyservidor;
  7.  
  8. import java.io.*;
  9. import java.net.*;
  10.  
  11. public class Cliente {
  12. static String HOST="";
  13. static final int Puerto=5000;
  14. public Cliente( ) throws IOException {
  15. try{
  16. Socket skCliente = new Socket( HOST , Puerto );
  17. InputStream aux = skCliente.getInputStream();
  18. DataInputStream flujo = new DataInputStream( aux );
  19.  
  20. System.out.println( flujo.readUTF() );
  21. }catch(Exception e){
  22. System.out.println(e.getMessage());
  23. }
  24. }
  25.  
  26. public static void main(String[] arg) throws IOException{
  27. HOST=arg[0];
  28. new Cliente();
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment