예제 #1
0
파일: connection.go 프로젝트: Carbyn/iris
func newConnection(websocketConn *websocket.Conn, s *server) *connection {
	c := &connection{
		id:        utils.RandomString(64),
		underline: websocketConn,
		send:      make(chan []byte, 256),
		onDisconnectListeners:    make([]DisconnectFunc, 0),
		onErrorListeners:         make([]ErrorFunc, 0),
		onNativeMessageListeners: make([]NativeMessageFunc, 0),
		onEventListeners:         make(map[string][]MessageFunc, 0),
		server:                   s,
	}

	c.self = newEmitter(c, c.id)
	c.broadcast = newEmitter(c, NotMe)
	c.all = newEmitter(c, All)

	return c
}
예제 #2
0
파일: typescript.go 프로젝트: cokeboL/iris
// GetName ...
func (t *Plugin) GetName() string {
	return Name + "[" + utils.RandomString(10) + "]" // this allows the specific plugin to be registed more than one time
}