blob: 76f4f7d9410db926dd3c1dcc0cbf10a4b8ddb255 [file] [log] [blame]
Don Newton379ae252019-04-01 12:17:06 -04001// 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
7package 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.
15type 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.
27func Listen(network, address string) (Listener, error) { return nil, nil }