MCPcopy
hub / github.com/jackc/pgx / Send

Method Send

pgproto3/backend.go:61–77  ·  view source on GitHub ↗

Send sends a message to the frontend (i.e. the client). The message is buffered until Flush is called. Any error encountered will be returned from Flush.

(msg BackendMessage)

Source from the content-addressed store, hash-verified

59// Send sends a message to the frontend (i.e. the client). The message is buffered until Flush is called. Any error
60// encountered will be returned from Flush.
61func (b *Backend) Send(msg BackendMessage) {
62 if b.encodeError != nil {
63 return
64 }
65
66 prevLen := len(b.wbuf)
67 newBuf, err := msg.Encode(b.wbuf)
68 if err != nil {
69 b.encodeError = err
70 return
71 }
72 b.wbuf = newBuf
73
74 if b.tracer != nil {
75 b.tracer.traceMessage('B', int32(len(b.wbuf)-prevLen), msg)
76 }
77}
78
79// Flush writes any pending messages to the frontend (i.e. the client).
80func (b *Backend) Flush() error {

Callers 11

StepMethod · 0.45
gssAuthMethod · 0.45
scramAuthMethod · 0.45
connectOneFunction · 0.45
txPasswordMessageMethod · 0.45
CloseMethod · 0.45
asyncCloseMethod · 0.45
CopyFromMethod · 0.45
SendFlushRequestMethod · 0.45
oauthAuthMethod · 0.45

Calls 2

traceMessageMethod · 0.80
EncodeMethod · 0.65