Skip to content

Instantly share code, notes, and snippets.

View thiagodiogo's full-sized avatar
😀
Provable privacy = Math applied to privacy

Thiago Diogo thiagodiogo

😀
Provable privacy = Math applied to privacy
  • São Paulo, Brazil
View GitHub Profile
public class Main {
public static void main(String args[]){
ServerSocketThiago server;
server = new ServerSocketThiago();
server.iniciaServidor();
System.out.println("Servidor iniciado");
ClientSocketThiago client;
public void iniciaCliente(){
try {
System.out.print("\nCliente tentando conectar com oservidor...");
client = new Socket(enderecoDoServidor, porta);
System.out.print("\n Conexão estabelecida...");
in = new DataInputStream((client.getInputStream()));
out = new DataOutputStream(client.getOutputStream());
//Enviando a hora agora (T1)
out.writeUTF(String.valueOf(System.currentTimeMillis()));