blob: 7672c4f508639357f06d871a4e565e3b3378251a [file] [log] [blame]
Jordan Bayles1c785bd2019-08-15 10:32:33 -07001// Copyright 2019 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef PLATFORM_BASE_SOCKET_STATE_H_
6#define PLATFORM_BASE_SOCKET_STATE_H_
7
8#include <cstdint>
9#include <memory>
10#include <string>
11
12namespace openscreen {
Jordan Bayles1c785bd2019-08-15 10:32:33 -070013
14// SocketState should be used by TCP and TLS sockets for indicating
15// current state. NOTE: socket state transitions should only happen in
16// the listed order. New states should be added in appropriate order.
17enum class SocketState {
18 // Socket is not connected.
19 kNotConnected = 0,
20
21 // Socket is currently being connected.
22 kConnecting,
23
24 // Socket is actively connected to a remote address.
25 kConnected,
26
27 // The socket connection has been terminated, either by Close() or
28 // by the remote side.
29 kClosed
30};
31
Jordan Bayles1c785bd2019-08-15 10:32:33 -070032} // namespace openscreen
33
34#endif // PLATFORM_BASE_SOCKET_STATE_H_