Skip to content

Commit

Permalink
added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
raspi committed Aug 6, 2022
1 parent 44789ef commit 2b75a6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/server/internal/serverclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

// ServerClient is a client connected to a server
// it is used internally to track connected client
// it is used internally by server.Server to track connected client
type ServerClient struct {
conn *net.UnixConn
connectedAt time.Time
Expand Down
5 changes: 3 additions & 2 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ const ConnType = `unixpacket`
// StartPacketId determines the starting packet ID for Server
const StartPacketId = uint64(100000)

// Server listens on unix domain socket for client.Client connections
type Server struct {
listener *net.UnixListener // Listening unix domain socket
clients map[uint64]*serverclient.ServerClient // Connected clients
packetId uint64 // Packet tracking ID
errch chan error2.Error // Errors
tooSlowPacketsBehind uint64 // How many packets can connected client lag behind
messagesCh chan []byte // messages sent to connected clients
connectionNew chan *net.UnixConn
messagesCh chan []byte // Channel for messages sent to all connected clients
connectionNew chan *net.UnixConn // Channel which is used to add new connections to the Server.clients connection pool
lock sync.Mutex
}

Expand Down

0 comments on commit 2b75a6f

Please sign in to comment.