Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/panjf2000/gnet
/ functions
Functions
759 in github.com/panjf2000/gnet
⨍
Functions
759
◇
Types & classes
122
↓ 3 callers
Function
loadOptions
(options ...Option)
options.go:26
↓ 3 callers
Function
netDial
(network string, a T)
os_unix_test.go:257
↓ 3 callers
Function
packUDPConn
(c *conn, buf []byte)
connection_windows.go:83
↓ 3 callers
Method
pushBack
pushBack adds a new node to the tail of l.
pkg/buffer/linkedlist/linked_list_buffer.go:304
↓ 3 callers
Function
registerInitConn
(el *eventloop)
eventloop_unix_test.go:36
↓ 3 callers
Method
sendTo
(buf []byte, addr unix.Sockaddr)
connection_unix.go:292
↓ 3 callers
Function
startClient
(t *testing.T, network, addr string, multicore, async bool, packetSize int, stallCh chan struct{})
gnet_test.go:827
↓ 3 callers
Function
sysSocket
(family, sotype, proto int)
pkg/socket/sys_cloexec.go:25
↓ 2 callers
Function
Accept
Accept accepts the next incoming socket along with setting O_NONBLOCK and O_CLOEXEC flags on it.
pkg/socket/socket.go:62
↓ 2 callers
Method
Available
Available returns the length of available bytes to write.
pkg/buffer/elastic/elastic_ring_buffer.go:145
↓ 2 callers
Method
Encode
(buf []byte)
gnet_test.go:1852
↓ 2 callers
Method
EnrollContext
(nc net.Conn, ctx any)
client_windows.go:140
↓ 2 callers
Method
EventLoopIndex
EventLoopIndex returns the eventloop index.
internal/gfd/gfd.go:58
↓ 2 callers
Method
Fd
()
connection_windows.go:304
↓ 2 callers
Method
Fd
Fd returns the underlying fd.
internal/gfd/gfd.go:53
↓ 2 callers
Method
Infof
Infof logs messages at INFO level.
pkg/logging/logger.go:286
↓ 2 callers
Method
Len
()
pkg/pool/ringbuffer/ringbuffer.go:149
↓ 2 callers
Function
NewContext
NewContext returns a new context.Context that carries the value that will be attached to the Conn.
context.go:29
↓ 2 callers
Method
OnClose
OnClose fires when a connection has been closed. The parameter err is the last known connection error.
gnet.go:504
↓ 2 callers
Method
OnOpen
OnOpen fires when a new connection has been opened. The Conn c has information about the connection such as its local and remote addresses. The param
gnet.go:500
↓ 2 callers
Method
OnTick
OnTick fires immediately after the engine starts and will fire again following the duration specified by the delay return value.
gnet.go:513
↓ 2 callers
Method
OutboundBuffered
OutboundBuffered returns the number of bytes that can be read from the current buffer. it's not concurrency-safe, you must invoke it within any method
gnet.go:281
↓ 2 callers
Method
PeekWithBytes
PeekWithBytes is like Peek but accepts [][]byte and puts them onto head.
pkg/buffer/linkedlist/linked_list_buffer.go:142
↓ 2 callers
Method
ReadFrom
ReadFrom implements io.ReaderFrom.
pkg/buffer/elastic/elastic_ring_buffer.go:169
↓ 2 callers
Method
ReadFrom
ReadFrom implements io.ReaderFrom.
pkg/buffer/linkedlist/linked_list_buffer.go:201
↓ 2 callers
Method
Reset
Reset the read pointer and write pointer to zero.
pkg/buffer/elastic/elastic_ring_buffer.go:200
↓ 2 callers
Method
Schedule
Schedule is like Execute, but it allows you to specify when the runnable is executed. In other words, the runnable will be executed when the delay dur
gnet.go:415
↓ 2 callers
Function
SetIPv6Only
SetIPv6Only restricts a IPv6 socket to only process IPv6 requests or both IPv4 and IPv6 requests.
pkg/socket/sockopts_posix.go:56
↓ 2 callers
Method
SetLinger
SetLinger sets the behavior of Close on a connection which still has data waiting to be sent or to be acknowledged. If secs < 0 (the default), the op
gnet.go:348
↓ 2 callers
Function
SetNoDelay
SetNoDelay controls whether the operating system should delay packet transmission in hopes of sending fewer packets (Nagle's algorithm). The default
pkg/socket/sockopts_posix.go:34
↓ 2 callers
Function
SetRecvBuffer
SetRecvBuffer sets the size of the operating system's receive buffer associated with the connection.
pkg/socket/sockopts_posix.go:40
↓ 2 callers
Function
SetSendBuffer
SetSendBuffer sets the size of the operating system's transmit buffer associated with the connection.
pkg/socket/sockopts_posix.go:46
↓ 2 callers
Function
SockaddrToTCPOrUnixAddr
SockaddrToTCPOrUnixAddr converts a unix.Sockaddr to a net.TCPAddr or net.UnixAddr. Returns nil if conversion fails.
pkg/socket/sockaddr.go:114
↓ 2 callers
Function
Warnf
Warnf logs messages at WARN level.
pkg/logging/logger.go:261
↓ 2 callers
Function
WithLogLevel
WithLogLevel specifies the logging level for the local logging file.
options.go:283
↓ 2 callers
Function
WithLogPath
WithLogPath specifies a local path for logging file.
options.go:276
↓ 2 callers
Method
Write
Write appends data to this buffer.
pkg/buffer/elastic/elastic_ring_list_buffer.go:84
↓ 2 callers
Method
WriteTo
(w io.Writer)
connection_windows.go:270
↓ 2 callers
Method
WriteTo
WriteTo implements io.WriterTo.
pkg/buffer/linkedlist/linked_list_buffer.go:224
↓ 2 callers
Method
addWakeupEvent
()
pkg/netpoll/poller_kqueue_wakeup.go:25
↓ 2 callers
Function
bytes2iovec
(bs [][]byte)
pkg/io/io_bsd.go:62
↓ 2 callers
Function
createListeners
64KB
gnet.go:559
↓ 2 callers
Method
delConn
(c *conn)
conn_map.go:58
↓ 2 callers
Function
determineUDPProto
(proto string, addr *net.UDPAddr)
pkg/socket/udp_socket.go:61
↓ 2 callers
Method
drainWakeupEvent
()
pkg/netpoll/poller_kqueue_wakeup.go:54
↓ 2 callers
Method
dup
()
listener_unix.go:49
↓ 2 callers
Method
enroll
(c net.Conn, addr net.Addr, ctx any)
eventloop_unix.go:113
↓ 2 callers
Method
enroll
(c net.Conn, addr net.Addr, ctx any)
eventloop_windows.go:86
↓ 2 callers
Method
incConn
(delta int32)
eventloop_windows.go:140
↓ 2 callers
Method
incCount
(_ int, delta int32)
conn_map.go:44
↓ 2 callers
Function
index
(n uint32)
pkg/pool/byteslice/byteslice.go:74
↓ 2 callers
Function
initListener
(network, addr string, options *Options)
listener_unix.go:84
↓ 2 callers
Function
ip6ZoneToInt
ip6ZoneToInt converts an IP6 Zone net string to a unix int. Returns 0 if zone is "".
pkg/socket/sockaddr.go:140
↓ 2 callers
Function
ip6ZoneToString
ip6ZoneToString converts an IP6 Zone unix int to a net string, Returns "" if zone is 0.
pkg/socket/sockaddr.go:153
↓ 2 callers
Method
loadCount
()
conn_map.go:48
↓ 2 callers
Method
packPollAttachment
(handler netpoll.PollEventHandler)
listener_unix.go:44
↓ 2 callers
Method
processIO
(_ int, filter netpoll.IOEvent, flags netpoll.IOFlags)
connection_bsd.go:27
↓ 2 callers
Method
register0
(c *conn)
eventloop_unix.go:215
↓ 2 callers
Function
restorePollAttachment
(ptr unsafe.Pointer)
pkg/netpoll/poller_unix_ultimate.go:25
↓ 2 callers
Function
run
(eventHandler EventHandler, listeners []*listener, options *Options, addrs []string)
engine_unix.go:230
↓ 2 callers
Function
startStreamEchoServer
(t *testing.T, ln net.Listener)
gnet_test.go:2128
↓ 2 callers
Function
startUDPEchoServer
(t *testing.T, c *net.UDPConn)
gnet_test.go:2110
↓ 2 callers
Method
wake
(c *conn)
eventloop_unix.go:406
↓ 2 callers
Method
writev
(bs [][]byte)
connection_unix.go:187
↓ 1 callers
Method
AddRead
AddRead registers the given file descriptor with readable event to the poller.
pkg/netpoll/poller_epoll_ultimate.go:202
↓ 1 callers
Method
AddReadWrite
AddReadWrite registers the given file descriptor with readable and writable events to the poller.
pkg/netpoll/poller_epoll_default.go:189
↓ 1 callers
Method
AsyncWrite
Gfd return an uninitialized GFD which is not valid, this method is only implemented for compatibility, don't use it on Windows. func (c *conn) Gfd() g
connection_windows.go:469
↓ 1 callers
Function
BytesToString
BytesToString converts byte slice to a string without any memory allocation.
pkg/bs/bs.go:23
↓ 1 callers
Method
CloseWithCallback
CloseWithCallback closes the current connection, it's concurrency-safe. Usually you should provide a non-nil callback for this method, otherwise your
gnet.go:467
↓ 1 callers
Method
Decode
(c Conn)
gnet_test.go:1864
↓ 1 callers
Function
Default
Default instantiates a non-blocking goroutine pool with the capacity of DefaultAntsPoolSize.
pkg/pool/goroutine/goroutine.go:59
↓ 1 callers
Method
Dial
(network, addr string)
client_windows.go:120
↓ 1 callers
Method
DialContext
(network, addr string, ctx any)
client_windows.go:124
↓ 1 callers
Function
Fatalf
Fatalf logs messages at FATAL level.
pkg/logging/logger.go:275
↓ 1 callers
Method
Flush
Flush writes any buffered data to the underlying connection, it's not concurrency-safe, you must invoke it within any method in EventHandler.
gnet.go:277
↓ 1 callers
Function
FromNetAddrContext
FromNetAddrContext retrieves the net.Addr value from ctx, if any.
context.go:61
↓ 1 callers
Function
FromNetConnContext
FromNetConnContext retrieves the net.Conn value from ctx, if any.
context.go:47
↓ 1 callers
Method
Get
Get returns new byte buffer with zero length. The byte buffer may be returned to the pool via Put after the use in order to minimize GC overhead.
pkg/pool/ringbuffer/ringbuffer.go:72
↓ 1 callers
Function
IPAddrToSockaddr
IPAddrToSockaddr converts a net.IPAddr to a Sockaddr. Returns nil if conversion fails.
pkg/socket/sockaddr.go:50
↓ 1 callers
Method
Inc
()
internal/gfd/gfd.go:43
↓ 1 callers
Method
IsEmpty
IsEmpty reports whether l is empty.
pkg/buffer/linkedlist/linked_list_buffer.go:256
↓ 1 callers
Function
IsErrorEvent
IsErrorEvent checks if the event is an error event.
pkg/netpoll/defs_poller_epoll.go:57
↓ 1 callers
Function
IsReadEvent
IsReadEvent checks if the event is a read event.
pkg/netpoll/defs_poller_epoll.go:47
↓ 1 callers
Function
IsWriteEvent
IsWriteEvent checks if the event is a write event.
pkg/netpoll/defs_poller_epoll.go:52
↓ 1 callers
Method
ModRead
ModRead modifies the given file descriptor with readable event in the poller.
pkg/netpoll/poller_epoll_default.go:219
↓ 1 callers
Function
NetAddrToSockaddr
NetAddrToSockaddr converts a net.Addr to a Sockaddr. Returns nil if the input is invalid or conversion is not possible.
pkg/socket/sockaddr.go:32
↓ 1 callers
Function
NewNetAddrContext
NewNetAddrContext returns a new context.Context that carries the net.Addr value.
context.go:56
↓ 1 callers
Function
NewNetConnContext
NewNetConnContext returns a new context.Context that carries the net.Conn value.
context.go:42
↓ 1 callers
Method
OnBoot
OnBoot fires when the engine is ready for accepting connections. The parameter engine has information and various utilities.
gnet.go:524
↓ 1 callers
Method
OnClose
OnClose fires when a connection has been closed. The parameter err is the last known connection error.
gnet.go:541
↓ 1 callers
Method
OnOpen
OnOpen fires when a new connection has been opened. The parameter out is the return value which is going to be sent back to the remote.
gnet.go:535
↓ 1 callers
Method
OnTick
OnTick fires immediately after the engine starts and will fire again following the duration specified by the delay return value.
gnet.go:552
↓ 1 callers
Method
OnTraffic
OnTraffic fires when a local socket receives data from the remote.
gnet.go:546
↓ 1 callers
Method
Put
Put releases byte buffer obtained via Get to the pool. The buffer mustn't be accessed after returning to the pool.
pkg/pool/ringbuffer/ringbuffer.go:89
↓ 1 callers
Method
Read
(p []byte)
connection_windows.go:134
↓ 1 callers
Method
ReadFrom
(r io.Reader)
connection_unix.go:435
↓ 1 callers
Method
Reset
Reset resets the buffer.
pkg/buffer/elastic/elastic_ring_list_buffer.go:164
↓ 1 callers
Function
Rotate
Rotate is like Run but accepts multiple network addresses.
gnet.go:705
↓ 1 callers
Method
Sequence
Sequence returns the monotonic sequence, only used to prevent fd duplication.
internal/gfd/gfd.go:73
↓ 1 callers
Method
SetDeadline
SetDeadline implements net.Conn.
gnet.go:473
← previous
next →
201–300 of 759, ranked by callers