Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package clienteyservidor;
- import java.io.*;
- import java.net.*;
- public class Cliente {
- static String HOST="";
- static final int Puerto=5000;
- public Cliente( ) throws IOException {
- try{
- Socket skCliente = new Socket( HOST , Puerto );
- InputStream aux = skCliente.getInputStream();
- DataInputStream flujo = new DataInputStream( aux );
- System.out.println( flujo.readUTF() );
- }catch(Exception e){
- System.out.println(e.getMessage());
- }
- }
- public static void main(String[] arg) throws IOException{
- HOST=arg[0];
- new Cliente();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment