<commit_before>package main

import (
	"fmt"
	"net"
)

// Responsible for figuring out which other nodes are out there

var gossip *Gossip

type Gossip struct {
}

// Listen
func (this *Gossip) listen() {
	log.Infof("Starting gossip on port TCP/%d", conf.GossipPort)
	ln, err := net.Listen("tcp", fmt.Sprintf(":%d", conf.GossipPort))
	if err != nil {
		panicErr(err)
	}
	for {
		conn, err := ln.Accept()
		if err != nil {
			// handle error
		}
		go this.handleConnection(conn)
	}
}

// Handle connection
func (this *Gossip) handleConnection(conn net.Conn) {
	// @todo
}

func newGossip() *Gossip {
	g := &Gossip{}

	// Start server
	go g.listen()

	return g
}<commit_msg>Read gossip bytes<commit_after>package main

import (
	"fmt"
	"io"
	"net"
)

// Responsible for figuring out which other nodes are out there

var gossip *Gossip

type Gossip struct {
}

// Listen
func (this *Gossip) listen() {
	log.Infof("Starting gossip on port TCP/%d", conf.GossipPort)
	ln, err := net.Listen("tcp", fmt.Sprintf(":%d", conf.GossipPort))
	if err != nil {
		panicErr(err)
	}
	for {
		conn, err := ln.Accept()
		if err != nil {
			// handle error
		}
		go this.handleConnection(conn)
	}
}

// Handle connection
func (this *Gossip) handleConnection(conn net.Conn) {
	// Read bytes
	tbuf := make([]byte, 8096)

	for {
		n, err := conn.Read(tbuf)
		// Was there an error in reading ?
		if err != nil {
			if err != io.EOF {
				log.Printf("Read error: %s", err)
			}
			break
		}
		log.Infof("Bytes %v", tbuf[0:n])
	}
}

func newGossip() *Gossip {
	g := &Gossip{}

	// Start server
	go g.listen()

	return g
}
{'fraction_non_alphanumeric': 0.15558343789209536, 'fraction_numerical': 0.003136762860727729, 'mean_word_length': 3.1321243523316062, 'pattern_counts': {'":': 2, '<': 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': '2784755', 'n_tokens_mistral': 645, 'n_tokens_neox': 597, 'n_words': 173}