Don Newton | 379ae25 | 2019-04-01 12:17:06 -0400 | [diff] [blame^] | 1 | // Copyright (C) MongoDB, Inc. 2017-present. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | // not use this file except in compliance with the License. You may obtain |
| 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | |
| 7 | package connection |
| 8 | |
| 9 | // Listener is a generic mongodb network protocol listener. It can return connections |
| 10 | // that speak the mongodb wire protocol. |
| 11 | // |
| 12 | // Multiple goroutines may invoke methods on a Listener simultaneously. |
| 13 | // |
| 14 | // TODO(GODRIVER-270): Implement this. |
| 15 | type Listener interface { |
| 16 | // Accept waits for and returns the next Connection to the listener. |
| 17 | Accept() (Connection, error) |
| 18 | |
| 19 | // Close closes the listener. |
| 20 | Close() error |
| 21 | |
| 22 | // Addr returns the listener's network address. |
| 23 | Addr() Addr |
| 24 | } |
| 25 | |
| 26 | // Listen creates a new listener on the provided network and address. |
| 27 | func Listen(network, address string) (Listener, error) { return nil, nil } |