Documentation ¶
Index ¶
Constants ¶
View Source
const ( DEFAULT_NAMESPACE = "lobby" MAX_READ_BUF_SIZE = 1024 MAX_WRITE_BUF_SIZE = 1024 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements http.Handler and SocketServer
func NewServer ¶
func NewServer(handler connection.ConnectionHandler, nsHandler connection.NamespaceHandler) *Server
func (*Server) Emit ¶
func (s *Server) Emit(eventName string, conn connection.Connection)
func (*Server) On ¶
func (s *Server) On(eventName string, callback ServerEventCallback)
type ServerEventCallback ¶
type ServerEventCallback func(connection.Connection)
type SocketServer ¶
type SocketServer interface { // On receives a string and a ServerEventCallback function and stores // the callback in an internal list, mapped to the given string. On(string, ServerEventCallback) // Emit receives a string and a Socket connection, and calls every ServerEventCallback // mapped to that string, passing the Socket connection as its only argument. Emit(string, connection.Connection) }
Click to show internal directories.
Click to hide internal directories.