networking

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DialTCP

func DialTCP(comm *P2PComm, dst int, address string)

func EstablishConnections

func EstablishConnections(wg *sync.WaitGroup, comm *P2PComm, partyID int, totalParties int)

func ListenTCP

func ListenTCP(comm *P2PComm, port string, src int)

Types

type Communicator

type Communicator interface {
	Send(dst int, msg []byte) (int, error)
	Recv(src int) ([]byte, int, error)
	Close() error
}

type P2PComm

type P2PComm struct {
	Socks map[int]*net.Conn
	Rank  int
	// contains filtered or unexported fields
}

func (*P2PComm) Close

func (comm *P2PComm) Close() error

func (*P2PComm) GetSock

func (comm *P2PComm) GetSock(key int) *net.Conn

func (*P2PComm) Recv

func (comm *P2PComm) Recv(reader *bufio.Reader, src int) ([]byte, int, error)

func (*P2PComm) RecvBytesMap

func (comm *P2PComm) RecvBytesMap(reader *bufio.Reader, src int) map[int][]byte

func (*P2PComm) RecvBytesSlice

func (comm *P2PComm) RecvBytesSlice(reader *bufio.Reader, src int) [][]byte

func (*P2PComm) RecvBytesSliceMap

func (comm *P2PComm) RecvBytesSliceMap(reader *bufio.Reader, src int) map[int][][]byte

func (*P2PComm) RecvMatrix

func (comm *P2PComm) RecvMatrix(reader *bufio.Reader, src int, length int) structs.Matrix[ring.Poly]

func (*P2PComm) RecvVector

func (comm *P2PComm) RecvVector(reader *bufio.Reader, src int, length int) structs.Vector[ring.Poly]

func (*P2PComm) SendBytes

func (comm *P2PComm) SendBytes(writer *bufio.Writer, dst int, msg []byte) (int, error)

func (*P2PComm) SendBytesMap

func (comm *P2PComm) SendBytesMap(writer *bufio.Writer, dst int, data map[int][]byte)

func (*P2PComm) SendBytesSlice

func (comm *P2PComm) SendBytesSlice(writer *bufio.Writer, dst int, data [][]byte)

func (*P2PComm) SendBytesSliceMap

func (comm *P2PComm) SendBytesSliceMap(writer *bufio.Writer, dst int, data map[int][][]byte)

func (*P2PComm) SendMatrix

func (comm *P2PComm) SendMatrix(writer *bufio.Writer, dst int, msg structs.Matrix[ring.Poly])

func (*P2PComm) SendVector

func (comm *P2PComm) SendVector(writer *bufio.Writer, dst int, msg structs.Vector[ring.Poly])

func (*P2PComm) SetSock

func (comm *P2PComm) SetSock(key int, conn *net.Conn)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL