Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckerFunc ¶
CheckerFunc is function to check request.
type Conn ¶
type Conn interface {
ID() string
NextReader() (session.FrameType, io.ReadCloser, error)
NextWriter(fType session.FrameType) (io.WriteCloser, error)
Close() error
URL() url.URL
LocalAddr() net.Addr
RemoteAddr() net.Addr
RemoteHeader() http.Header
SetContext(v interface{})
Context() interface{}
}
Conn is connection by client session
type ConnInitorFunc ¶
ConnInitorFunc is function to do after create connection.
type Opener ¶
type Opener interface {
Open() (transport.ConnParameters, error)
}
Opener is client connection which need receive open message first.
type Options ¶
type Options struct {
PingTimeout time.Duration
PingInterval time.Duration
Transports []transport.Transport
SessionIDGenerator session.IDGenerator
RequestChecker CheckerFunc
ConnInitor ConnInitorFunc
// Logger receives errors and diagnostics from the server and the sessions
// it creates. nil means logger.Log. It chooses the sink only: logger.Level
// decides what is enabled while it is not logger.LevelUnset (set from
// SOCKETIO_LOG_LEVEL or by logger.Level.Set), the handler otherwise.
// Transports, the parser, the packet codec and the client dialer do not
// have access to Options and keep using logger.Log.
Logger *slog.Logger
// WriteBufferSize is the number of outbound socket.io packets each connection of
// a socketio.Server or socketio.Client queues; 0 and negative values mean 64. It
// is unrelated to websocket.Transport.WriteBufferSize, which counts bytes, and
// the engine.io server ignores it. A packet the writer has started no longer
// counts. An Emit that finds the queue full closes the connection without
// draining it (see socketio.ErrWriteBufferFull), so more than WriteBufferSize
// packets queued faster than the writer sends them can close a healthy client.
// Polling writes one engine.io frame per poll round trip, and a packet with k
// binary attachments takes k+1 frames, so polling clients overflow at much lower
// emit rates than websocket clients. Temporary v1 placement.
WriteBufferSize int
}
Options is options to create a server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is instance of server
func (*Server) Close ¶
Close closes server. Accept returns io.EOF from then on. Every session not yet returned by Accept, and every session whose handshake completes later, is closed and removed; sessions already accepted stay open.
Click to show internal directories.
Click to hide internal directories.