MCPcopy Create free account
hub / github.com/dolthub/doltgresql / Send

Method Send

testing/go/wire_test.go:7561–7583  ·  view source on GitHub ↗

Send sends the given messages over the wire. If an error is returned, then the connection has been closed, and a new one should be opened.

(t *testing.T, messages ...pgproto3.FrontendMessage)

Source from the content-addressed store, hash-verified

7559// Send sends the given messages over the wire. If an error is returned, then the connection has been closed, and a new
7560// one should be opened.
7561func (c *RawWireConnection) Send(t *testing.T, messages ...pgproto3.FrontendMessage) error {
7562 if len(messages) == 0 {
7563 return nil
7564 }
7565 hasMessage := false
7566 for _, message := range messages {
7567 if message == nil {
7568 continue
7569 }
7570 hasMessage = true
7571 if startupMessage, ok := message.(*pgproto3.StartupMessage); ok {
7572 c.startup = startupMessage
7573 }
7574 c.frontend.Send(message)
7575 }
7576 if !hasMessage {
7577 return nil
7578 }
7579 go func() {
7580 c.errChan <- c.frontend.Flush()
7581 }()
7582 return c.handleErrorChannel(t, true)
7583}
7584
7585// init handles the startup message, authentication, and initial messages from the server.
7586func (c *RawWireConnection) init(t *testing.T) {

Callers 6

initMethod · 0.95
RunWireScriptsFunction · 0.95
spoolRowsCallbackMethod · 0.45
sendMethod · 0.45
handleStartupFunction · 0.45
createPassthroughFunction · 0.45

Calls 2

handleErrorChannelMethod · 0.95
FlushMethod · 0.80

Tested by

no test coverage detected