func (n *Net) NetworkID() int8 {
	return n.networkID
}
NetworkID retuers Net's network ID
package net
import (
	"context"
	"errors"
	"fmt"
	"net"
	"strconv"
	"sync"
	"github.com/libonomy/libonomy-p2p/common/types"
	"github.com/libonomy/libonomy-p2p/log"
	"github.com/libonomy/libonomy-p2p/p2p/config"
	"github.com/libonomy/libonomy-p2p/p2p/node"
	"github.com/libonomy/libonomy-p2p/p2p/p2pcrypto"
	"github.com/libonomy/libonomy-p2p/p2p/version"
	"time"
)
const DefaultQueueCount uint = 6
const DefaultMessageQueueSize uint = 5120
const (
	ReadBufferSize = 5 * 1024 * 1024
	WriteBufferSize = 5 * 1024 * 1024
	TCPKeepAlive = true
	TCPKeepAlivePeriod = 10 * time.Second
)
type IncomingMessageEvent struct {
	Conn    Connection
	Message []byte
}
type ManagedConnection interface {
	Connection
	beginEventProcessing()
}
type Net struct {
	networkID int8
	localNode node.LocalNode
	logger    log.Log
	listener      net.Listener
	listenAddress *net.TCPAddr  
	isShuttingDown bool
	regMutex         sync.RWMutex
	regNewRemoteConn []func(NewConnectionEvent)
	clsMutex           sync.RWMutex
	closingConnections []func(ConnectionWithErr)
	queuesCount           uint
	incomingMessagesQueue []chan IncomingMessageEvent
	config config.Config
}
type NewConnectionEvent struct {
	Conn Connection
	Node *node.Info
}
func NewNet(conf config.Config, localEntity node.LocalNode, logger log.Log) (*Net, error) {
	qcount := DefaultQueueCount       
	qsize := DefaultMessageQueueSize  
	n := &Net{
		networkID:             conf.NetworkID,
		localNode:             localEntity,
		logger:                logger,
		regNewRemoteConn:      make([]func(NewConnectionEvent), 0, 3),
		closingConnections:    make([]func(cwe ConnectionWithErr), 0, 3),
		queuesCount:           qcount,
		incomingMessagesQueue: make([]chan IncomingMessageEvent, qcount),
		config:                conf,
	}
	for imq := range n.incomingMessagesQueue {
		n.incomingMessagesQueue[imq] = make(chan IncomingMessageEvent, qsize)
	}
	return n, nil
}
func (n *Net) Start(listener net.Listener) {  
	n.listener = listener
	n.listenAddress = listener.Addr().(*net.TCPAddr)
	n.logger.Info("Started TCP server listening for connections on tcp:%v", listener.Addr().String())
	go n.accept(listener)
}
func (n *Net) LocalAddr() net.Addr {
	return n.listener.Addr()
}
func (n *Net) Logger() log.Log {
	return n.logger
}