MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / ptyToClient

Method ptyToClient

modules/clibridge/clibridge.go:342–357  ·  view source on GitHub ↗
(sess *Session)

Source from the content-addressed store, hash-verified

340}
341
342func (m *CLIBridgeModule) ptyToClient(sess *Session) {
343 buf := make([]byte, 4096)
344 for {
345 n, err := sess.PtyFile.Read(buf)
346 if n > 0 {
347 data := buf[:n]
348 if sess.isTelnet {
349 data = escapeIAC(data)
350 }
351 connections.SendRawTo(data, sess.ConnectionId)
352 }
353 if err != nil {
354 return
355 }
356 }
357}
358
359func escapeIAC(data []byte) []byte {
360 count := 0

Callers 1

onCLIRequestMethod · 0.95

Calls 3

SendRawToFunction · 0.92
escapeIACFunction · 0.85
ReadMethod · 0.65

Tested by

no test coverage detected