<commit_before>package Servers;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;
import java.util.HashMap;
import java.util.Scanner;
import Messages.ClientToServerResponse;

/**
 * Created by teodorosaavedra on 20-09-16.
 */
public class CentralServer implements Runnable{

    private HashMap<String,ClientToServerResponse> diccionario;
    private int port;
    private DatagramSocket socket;
    private byte[] buffer;

    public CentralServer(){
        diccionario = new HashMap<String, ClientToServerResponse>();
        port = 9876;
        buffer = new byte[2048];
    }

    public void addToDictionary(ClientToServerResponse server){
        diccionario.put(server.getServerName(),server);
    }

    public ClientToServerResponse getResponse(String server_name){
        return diccionario.get(server_name);
    }

    public void SendResponsetoClient(ClientToServerResponse response, InetAddress address){
        try{
            DatagramSocket socket = new DatagramSocket();
            ByteArrayOutputStream stream = new ByteArrayOutputStream();
            ObjectOutput oo = new ObjectOutputStream(stream);<commit_msg>Fix port client-to-central server<commit_after>package Servers;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;
import java.util.HashMap;
import java.util.Scanner;
import Messages.ClientToServerResponse;

/**
 * Created by teodorosaavedra on 20-09-16.
 */
public class CentralServer implements Runnable{

    private HashMap<String,ClientToServerResponse> diccionario;
    private int port;
    private DatagramSocket socket;
    private byte[] buffer;

    public CentralServer(){
        diccionario = new HashMap<String, ClientToServerResponse>();
        port = 49876;
        buffer = new byte[2048];
    }

    public void addToDictionary(ClientToServerResponse server){
        diccionario.put(server.getServerName(),server);
    }

    public ClientToServerResponse getResponse(String server_name){
        return diccionario.get(server_name);
    }

    public void SendResponsetoClient(ClientToServerResponse response, InetAddress address){
        try{
            DatagramSocket socket = new DatagramSocket();
            ByteArrayOutputStream stream = new ByteArrayOutputStream();
            ObjectOutput oo = new ObjectOutputStream(stream);
{'fraction_non_alphanumeric': 0.08127077946065756, 'fraction_numerical': 0.010712966383450314, 'mean_word_length': 4.071161048689139, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5907117', 'n_tokens_mistral': 752, 'n_tokens_neox': 713, 'n_words': 176}