123456789101112131415161718192021222324252627282930 |
- package serverres;
- import java.net.UnknownHostException;
- import rsx.tcp.TcpClient;
- import rsx.udp.Broadcast;
- /**
- * Exemple appel vers le serveur
- * @author Arthur Brandao
- */
- public class ServerRes {
- /**
- * @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", 18426);
- cli.connect();
- cli.send("Bonjour");
- System.out.println(cli.receive());
- cli.close();
-
- }
-
- }
|