go.nanomsg.org/mangos/v3@v3.4.3-0.20240217232803-46464076f1f5/listener.go (about) 1 // Copyright 2015 The Mangos Authors 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use file except in compliance with the License. 5 // You may obtain a copy of the license at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package mangos 16 17 // Listener is an interface to the underlying listener for a transport 18 // and address. 19 type Listener interface { 20 // Close closes the listener, and removes it from any active socket. 21 // Further operations on the Listener will return ErrClosed. 22 Close() error 23 24 // Listen starts listening for new connectons on the address. 25 Listen() error 26 27 // Address returns the string (full URL) of the Listener. 28 Address() string 29 30 // SetOption sets an option on the Listener. Setting options 31 // can only be done before Listen() has been called. 32 SetOption(name string, value interface{}) error 33 34 // GetOption gets an option value from the Listener. 35 GetOption(name string) (interface{}, error) 36 }