Server.java 501 Bytes
Newer Older
Luca Arrotta's avatar
Luca Arrotta committed
1
package actor;
Riccardo Presotto's avatar
Riccardo Presotto committed
2

Luca Arrotta's avatar
Luca Arrotta committed
3
import it.ewlab.actor.ActorOuterClass.Actor;
Riccardo Presotto's avatar
Riccardo Presotto committed
4 5 6 7 8 9 10 11 12

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {

    public static void main(String[] args) throws IOException {

13
        System.out.println("The server is running...\n");
Riccardo Presotto's avatar
Riccardo Presotto committed
14 15 16 17 18

        ServerSocket serverSocket = new ServerSocket(9999);

        Socket s = serverSocket.accept();

Luca Arrotta's avatar
Luca Arrotta committed
19
        Actor actor = Actor.parseFrom(s.getInputStream());
Riccardo Presotto's avatar
Riccardo Presotto committed
20

Luca Arrotta's avatar
Luca Arrotta committed
21
        System.out.println(actor);
Riccardo Presotto's avatar
Riccardo Presotto committed
22 23 24 25
    }


}