2016-09-25 17:23:39 -07:00
|
|
|
/*----------------------------------------------------------------------------*/
|
2018-01-01 17:32:39 -08:00
|
|
|
/* Copyright (c) 2015-2018 FIRST. All Rights Reserved. */
|
2016-09-25 17:23:39 -07:00
|
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
|
|
|
|
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
|
|
|
|
/* the project. */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
#ifndef WPIUTIL_WPI_NETWORKACCEPTOR_H_
|
|
|
|
|
#define WPIUTIL_WPI_NETWORKACCEPTOR_H_
|
2016-09-25 17:23:39 -07:00
|
|
|
|
2017-10-21 20:31:20 -07:00
|
|
|
#include <memory>
|
|
|
|
|
|
2018-04-29 23:33:19 -07:00
|
|
|
#include "wpi/NetworkStream.h"
|
2016-09-25 17:23:39 -07:00
|
|
|
|
|
|
|
|
namespace wpi {
|
|
|
|
|
|
|
|
|
|
class NetworkAcceptor {
|
|
|
|
|
public:
|
|
|
|
|
NetworkAcceptor() = default;
|
|
|
|
|
virtual ~NetworkAcceptor() = default;
|
|
|
|
|
|
|
|
|
|
virtual int start() = 0;
|
|
|
|
|
virtual void shutdown() = 0;
|
|
|
|
|
virtual std::unique_ptr<NetworkStream> accept() = 0;
|
|
|
|
|
|
|
|
|
|
NetworkAcceptor(const NetworkAcceptor&) = delete;
|
|
|
|
|
NetworkAcceptor& operator=(const NetworkAcceptor&) = delete;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace wpi
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
#endif // WPIUTIL_WPI_NETWORKACCEPTOR_H_
|