package net.mc_pandacraft.java.plugin.pandacraftutils.network_api.client_test;

import java.io.PrintStream;
import java.net.Socket;

public class ClientTest {

	public static void main(String[] args) throws Exception {
		System.out.println("--- connexion ...");
		Socket s = new Socket("localhost", 12485);
		System.out.println("--- connecté");
		
		PrintStream out = new PrintStream(s.getOutputStream());
		
		AbstractRequest request = new RequestCommand("say Salut :)");
		
		request.sendPacket(out);
		
		s.shutdownOutput();
		
		System.out.println("--- requête envoyée");
		request.sendPacket(System.out);
		System.out.println();
		
		System.out.println("--- réponse du serveur :");
		ResponseAnalyser response = new ResponseAnalyser(s);
		
		System.out.println(response.good);
		System.out.println(response.data);
		
		s.close();
	}
	
	
}


