12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- package test;
- import java.net.UnknownHostException;
- import java.util.ArrayList;
- import rsx.BomberStudentClient;
- import rsx.BomberStudentReponse;
- import rsx.tcp.TcpClient;
- /**
- * Exemple appel vers le serveur
- * @author Arthur Brandao
- */
- public class ServerTest {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) throws UnknownHostException {
-
- /*
- Broadcast b = new Broadcast(18426);
- System.out.println(b.search("i'm a bomberstudent server"));
- System.out.println("Resultat : " + !b.getServers().isEmpty());
- //*/
- /*
- TcpClient cli = new TcpClient("127.0.0.1", 18642);
- cli.connect();
- cli.send("Bonjour toi le serveur comment que ça va ?");
- System.out.println(cli.receive());
- cli.close();
- //*/
- //*
- BomberStudentClient bsc = new BomberStudentClient();
- int a = bsc.findServer();
- System.out.println(a);
- if(a == 0){
- System.err.println("Aucun serveur");
- return;
- }
- bsc.selectServer(0);
- bsc.send("POST", "aze/rty");
- BomberStudentReponse bsr = bsc.receive();
- //*/
- }
-
- }
|