<commit_before>package com.dumbster.smtp;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;

public class SocketWrapper implements IOSource {
    private Socket socket;

    public SocketWrapper(Socket socket)  {
        this.socket = socket;
    }

    public BufferedReader getInputStream() throws IOException {
        return new BufferedReader(
                new InputStreamReader(socket.getInputStream()));
    }

    public PrintWriter getOutputStream() throws IOException {
        return new PrintWriter(socket.getOutputStream());
    }

    public void close() throws IOException {
        socket.close();
    }

}<commit_msg>Set the socket timeout so clients can't DoS.  Thank you, vladimirdyuzhev!<commit_after>package com.dumbster.smtp;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;

public class SocketWrapper implements IOSource {
    private Socket socket;

    public SocketWrapper(Socket socket) throws IOException {
        this.socket = socket;
        this.socket.setSoTimeout(10000); // protects against hanged clients
    }

    public BufferedReader getInputStream() throws IOException {
        return new BufferedReader(
                new InputStreamReader(socket.getInputStream()));
    }

    public PrintWriter getOutputStream() throws IOException {
        return new PrintWriter(socket.getOutputStream());
    }

    public void close() throws IOException {
        socket.close();
    }

}
{'fraction_non_alphanumeric': 0.08209876543209876, 'fraction_numerical': 0.0030864197530864196, 'mean_word_length': 3.42896174863388, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4638644', 'n_tokens_mistral': 435, 'n_tokens_neox': 414, 'n_words': 115}