<commit_before>package org.jnode.nntp;

import jnode.event.IEvent;
import jnode.logger.Logger;
import jnode.main.MainHandler;
import jnode.module.JnodeModule;
import jnode.module.JnodeModuleException;

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

/**
 * <a href="http://tools.ietf.org/html/rfc2980">RFC 2980 - Common NNTP Extensions</a><br>
 * <a href="http://tools.ietf.org/html/rfc3977">RFC 3977 - Network News Transfer Protocol (NNTP)</a><br>
 * <a href="http://tools.ietf.org/html/rfc6048">RFC 6048 - Network News Transfer Protocol (NNTP) Additions to LIST Command</a><br>
 */
public class NntpModule extends JnodeModule {

    private Logger logger = Logger.getLogger(NntpModule.class);

    private static final int PORT = 1119;

    public NntpModule(String configFile) throws JnodeModuleException {
        super(configFile);
        try {
            new MainHandler(configFile);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @Override
    public void start() {
        while (!Thread.currentThread().isInterrupted()) {
            try (ServerSocket serverSocket = new ServerSocket(PORT)) {
                Socket socket = serverSocket.accept();

                try {
                    Thread.sleep(1000);<commit_msg>initial implementation of nntp server<commit_after>package org.jnode.nntp;

import jnode.event.IEvent;
import jnode.logger.Logger;
import jnode.main.MainHandler;
import jnode.module.JnodeModule;
import jnode.module.JnodeModuleException;

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

/**
 * <a href="http://tools.ietf.org/html/rfc2980">RFC 2980 - Common NNTP Extensions</a><br>
 * <a href="http://tools.ietf.org/html/rfc3977">RFC 3977 - Network News Transfer Protocol (NNTP)</a><br>
 * <a href="http://tools.ietf.org/html/rfc6048">RFC 6048 - Network News Transfer Protocol (NNTP) Additions to LIST Command</a><br>
 */
public class NntpModule extends JnodeModule {

    private Logger logger = Logger.getLogger(NntpModule.class);

    private static final int PORT = 1119;

    public NntpModule(String configFile) throws JnodeModuleException {
        super(configFile);
    }

    @Override
    public void start() {
        while (!Thread.currentThread().isInterrupted()) {
            try (ServerSocket serverSocket = new ServerSocket(PORT)) {
                Socket socket = serverSocket.accept();

                try {
                    Thread.sleep(1000);
{'fraction_non_alphanumeric': 0.11832669322709163, 'fraction_numerical': 0.02549800796812749, 'mean_word_length': 3.220168067226891, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '3746148', 'n_tokens_mistral': 812, 'n_tokens_neox': 757, 'n_words': 172}