/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2015-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <folly/portability/Sockets.h>
#include <boost/scoped_array.hpp>
+#include <memory>
enum StateEnum {
STATE_WAITING,
}
StateEnum state;
- size_t bytesWritten;
+ std::atomic<size_t> bytesWritten;
folly::AsyncSocketException exception;
VoidCallback successCallback;
VoidCallback errorCallback;
std::shared_ptr<BlockingSocket> accept(int timeout=50) {
int fd = acceptFD(timeout);
- return std::shared_ptr<BlockingSocket>(new BlockingSocket(fd));
+ return std::make_shared<BlockingSocket>(fd);
}
std::shared_ptr<folly::AsyncSocket> acceptAsync(folly::EventBase* evb,