MCPcopy
hub / github.com/olahol/melody / Write

Method Write

session.go:160–168  ·  view source on GitHub ↗

Write writes message to session.

(msg []byte)

Source from the content-addressed store, hash-verified

158
159// Write writes message to session.
160func (s *Session) Write(msg []byte) error {
161 if s.closed() {
162 return ErrSessionClosed
163 }
164
165 s.writeMessage(envelope{t: websocket.TextMessage, msg: msg})
166
167 return nil
168}
169
170// WriteBinary writes a binary message to session.
171func (s *Session) WriteBinary(msg []byte) error {

Callers 12

TestEchoFunction · 0.80
TestWriteClosedServerFunction · 0.80
TestWriteClosedClientFunction · 0.80
TestUpgraderFunction · 0.80
TestHandleErrorWriteFunction · 0.80
TestErrSessionClosedFunction · 0.80
TestErrMessageBufferFullFunction · 0.80
TestSessionKeysFunction · 0.80
TestHandleSentMessageFunction · 0.80
BroadcastMultipleMethod · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls 2

closedMethod · 0.95
writeMessageMethod · 0.95

Tested by 9

TestEchoFunction · 0.64
TestWriteClosedServerFunction · 0.64
TestWriteClosedClientFunction · 0.64
TestUpgraderFunction · 0.64
TestHandleErrorWriteFunction · 0.64
TestErrSessionClosedFunction · 0.64
TestErrMessageBufferFullFunction · 0.64
TestSessionKeysFunction · 0.64
TestHandleSentMessageFunction · 0.64