Documentation
¶
Index ¶
- func BenchmarkStreamClientDialServerHandle(b *testing.B, newClient func(psc *PipeStreamClient) netio.StreamClient, ...)
- func BenchmarkStreamClientServer(b *testing.B, newClient func(psc *PipeStreamClient) netio.StreamClient, ...)
- func TestConnPairRoundTrip(t *testing.T, newConnPair func() (c1, c2 netio.Conn))
- func TestPreambleStreamClientServerProceed(t *testing.T, newClient func(psc *PipeStreamClient) netio.StreamClient, ...)
- func TestStreamClientServerAbort(t *testing.T, newClient func(psc *PipeStreamClient) netio.StreamClient, ...)
- func TestWrapConnStreamClientServerProceed(t *testing.T, newClient func(psc *PipeStreamClient) netio.StreamClient, ...)
- type PipeConn
- type PipeStreamClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BenchmarkStreamClientDialServerHandle ¶
func BenchmarkStreamClientDialServerHandle( b *testing.B, newClient func(psc *PipeStreamClient) netio.StreamClient, server netio.StreamServer, )
BenchmarkStreamClientDialServerHandle tests the performance of the stream client and server establishing and closing connections.
func BenchmarkStreamClientServer ¶
func BenchmarkStreamClientServer( b *testing.B, newClient func(psc *PipeStreamClient) netio.StreamClient, server netio.StreamServer, writeSize int, )
BenchmarkStreamClientServer tests the performance of the stream client and server connections.
func TestConnPairRoundTrip ¶
TestConnPairRoundTrip tests a pair of connections for round-trip communication.
func TestPreambleStreamClientServerProceed ¶
func TestPreambleStreamClientServerProceed( t *testing.T, newClient func(psc *PipeStreamClient) netio.StreamClient, server netio.StreamServer, expectedServerAddr conn.Addr, expectedUsername string, )
TestPreambleStreamClientServerProceed tests a pair of stream client and server implementations that, after performing whatever protocol-specific handshake, simply return the underlying connection to the caller.
func TestStreamClientServerAbort ¶
func TestStreamClientServerAbort( t *testing.T, newClient func(psc *PipeStreamClient) netio.StreamClient, server netio.StreamServer, checkDialErr func(t *testing.T, dialResult conn.DialResult, err error), )
TestStreamClientServerAbort tests a pair of stream client and server implementations for handling aborted connection requests.
func TestWrapConnStreamClientServerProceed ¶
func TestWrapConnStreamClientServerProceed( t *testing.T, newClient func(psc *PipeStreamClient) netio.StreamClient, server netio.StreamServer, expectedServerAddr conn.Addr, expectedUsername string, )
TestWrapConnStreamClientServerProceed tests a pair of stream client and server implementations that return wrapper connections over the underlying connection.
Types ¶
type PipeConn ¶
PipeConn is *netio.PipeConn with additional local and remote addresses.
func (*PipeConn) LocalConnAddr ¶
LocalConnAddr returns the local address of the connection, if known.
func (*PipeConn) RemoteConnAddr ¶
RemoteConnAddr returns the remote address of the connection, if known.
type PipeStreamClient ¶
type PipeStreamClient struct {
// contains filtered or unexported fields
}
PipeStreamClient handles stream connection requests by creating a pipe for each DialStream call and sending the server end to a channel.
func NewPipeStreamClient ¶
func NewPipeStreamClient(info netio.StreamDialerInfo) (*PipeStreamClient, <-chan *PipeConn)
NewPipeStreamClient returns a new *PipeStreamClient and a channel for receiving server ends of the pipes.
func (*PipeStreamClient) Close ¶
func (c *PipeStreamClient) Close() error
Close closes the pipe channel.
func (*PipeStreamClient) DialStream ¶
func (c *PipeStreamClient) DialStream(ctx context.Context, addr conn.Addr, payload []byte) (plc netio.Conn, err error)
DialStream implements netio.StreamDialer.DialStream.
func (*PipeStreamClient) NewStreamDialer ¶
func (c *PipeStreamClient) NewStreamDialer() (netio.StreamDialer, netio.StreamDialerInfo)
NewStreamDialer implements netio.StreamClient.NewStreamDialer.