Пример #1
0
func (ep *WebsocketConnection) Send(data []byte) {
	// core.Debug("Writing data")
	// Does the lock block? The locks should be faster than working off the channel,
	// but the comments in the other code imply that the lock blocks on the send?

	ep.lock.Lock()
	if err := ep.conn.WriteMessage(ep.payloadType, data); err != nil {
		core.Warn("No one is dealing with my errors! Cant write to socket. Eror: %s", err)
		panic("Unrecoverable error")
	}
	ep.lock.Unlock()
}
Пример #2
0
func Warn(s string)        { core.Warn("%s", s) }
Пример #3
0
//export Warn
func Warn(s *C.char) { core.Warn("%s", C.GoString(s)) }