1 // Copyright 2018 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 #include "osp/public/protocol_connection_server.h" 6 7 namespace openscreen { 8 namespace osp { 9 ProtocolConnectionServer(MessageDemuxer * demuxer,Observer * observer)10ProtocolConnectionServer::ProtocolConnectionServer(MessageDemuxer* demuxer, 11 Observer* observer) 12 : demuxer_(demuxer), 13 endpoint_request_ids_(EndpointRequestIds::Role::kServer), 14 observer_(observer) {} 15 16 ProtocolConnectionServer::~ProtocolConnectionServer() = default; 17 operator <<(std::ostream & os,ProtocolConnectionServer::State state)18std::ostream& operator<<(std::ostream& os, 19 ProtocolConnectionServer::State state) { 20 switch (state) { 21 case ProtocolConnectionServer::State::kStopped: 22 return os << "STOPPED"; 23 case ProtocolConnectionServer::State::kStarting: 24 return os << "STARTING"; 25 case ProtocolConnectionServer::State::kRunning: 26 return os << "RUNNING"; 27 case ProtocolConnectionServer::State::kStopping: 28 return os << "STOPPING"; 29 case ProtocolConnectionServer::State::kSuspended: 30 return os << "SUSPENDED"; 31 default: 32 return os << "UNKNOWN"; 33 } 34 } 35 36 } // namespace osp 37 } // namespace openscreen 38