Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scatter ¶
type Scatter struct {
// contains filtered or unexported fields
}
Scatter is used to passing data between c, mainConn and scatterConns.
Data reads from c will be write to mainConn and all scatterConns. Data reads from mainConn will be write to c. Data reads from scatterConns will be droped.
Scatter will stops when c or mainConn closed. And will not stop when any of scatterConns closed.
func NewScatter ¶
NewScatter creates Scatter used to pass messages between conn and connections created by mainAddr and scatterAddrs.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is used to manage scatters. When receiving a connection, server will create a Scatter to send and receive messages to remote address.
func (*Server) AddScatterAddr ¶
AddScatterAddr add a scatter address to the server.