zmq4: minor docs improvement and clarification

This commit is contained in:
Bartek Pacia 2022-11-06 10:31:44 +01:00 committed by GitHub
parent 217f26c4a3
commit 71973597eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

22
zmq4.go
View file

@ -11,37 +11,43 @@ import "net"
// Socket represents a ZeroMQ socket.
type Socket interface {
// Close closes the open Socket
// Close closes the open Socket.
Close() error
// Send puts the message on the outbound send queue.
//
// Send blocks until the message can be queued or the send deadline expires.
Send(msg Msg) error
// SendMulti puts the message on the outbound send queue.
// SendMulti blocks until the message can be queued or the send deadline expires.
// The message will be sent as a multipart message.
//
// SendMulti blocks until the message can be queued or the send deadline
// expires. The message will be sent as a multipart message.
SendMulti(msg Msg) error
// Recv receives a complete message.
Recv() (Msg, error)
// Listen connects a local endpoint to the Socket.
//
// In ZeroMQ's terminology, it binds.
Listen(ep string) error
// Dial connects a remote endpoint to the Socket.
//
// In ZeroMQ's terminology, it connects.
Dial(ep string) error
// Type returns the type of this Socket (PUB, SUB, ...)
// Type returns the type of this Socket (for example PUB, SUB, etc.)
Type() SocketType
// Addr returns the listener's address.
// Addr returns nil if the socket isn't a listener.
// Addr returns the listener's address. It returns nil if the socket isn't a
// listener.
Addr() net.Addr
// GetOption is used to retrieve an option for a socket.
// GetOption retrieves an option for a socket.
GetOption(name string) (interface{}, error)
// SetOption is used to set an option for a socket.
// SetOption sets an option for a socket.
SetOption(name string, value interface{}) error
}