Client.java 917 Bytes
Newer Older
Riccardo Presotto's avatar
Riccardo Presotto committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
package researcher;

import it.ewlab.researcher.ResearcherOuterClass.Researcher;

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

public class Client {

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

        Socket s = new Socket("localhost", 9999);

        Researcher r =
                Researcher.newBuilder()
                        .setName("Gabriele")
                        .setSurname("Civitarese")
                        .setType(Researcher.ResearcherType.POSTDOC)
                        .addPaper(Researcher.Paper.newBuilder().setTitle("Activity Recognition")
                                .setYear(2014).build())
                        .addPaper(Researcher.Paper.newBuilder().setTitle("Activity Recognition Again")
                                .setYear(2015).build())
                        .build();

        r.writeTo(s.getOutputStream());

        s.close();


    }
}