Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opt: byte alignment, optimization from 144 to 136 byte #369

Merged
merged 1 commit into from
May 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ import (
)

type conn struct {
fd int // file descriptor
ctx interface{} // user-defined context
peer unix.Sockaddr // remote socket address
loop *eventloop // connected event-loop
buffer []byte // buffer for the latest bytes
opened bool // connection opened event fired
localAddr net.Addr // local addr
remoteAddr net.Addr // remote addr
isDatagram bool // UDP protocol
inboundBuffer elastic.RingBuffer // buffer for leftover data from the peer
loop *eventloop // connected event-loop
outboundBuffer *elastic.Buffer // buffer for data that is eligible to be sent to the peer
pollAttachment *netpoll.PollAttachment // connection attachment for poller
inboundBuffer elastic.RingBuffer // buffer for leftover data from the peer
buffer []byte // buffer for the latest bytes
fd int // file descriptor
isDatagram bool // UDP protocol
opened bool // connection opened event fired
}

func newTCPConn(fd int, el *eventloop, sa unix.Sockaddr, localAddr, remoteAddr net.Addr) (c *conn) {
Expand Down