git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More jthreads.
[stg.git]
/
projects
/
rscriptd
/
listener.h
diff --git
a/projects/rscriptd/listener.h
b/projects/rscriptd/listener.h
index abc03f6f9e60e16f21b8a46bafb11aa9d70a8a04..7fb71ee388629e35b1788a4828331449aabc6feb 100644
(file)
--- a/
projects/rscriptd/listener.h
+++ b/
projects/rscriptd/listener.h
@@
-25,11
+25,11
@@
#include <vector>
#include <list>
#include <functional>
#include <vector>
#include <list>
#include <functional>
+#include <cstdint>
-#include "os_int.h"
-#include "blowfish.h"
-#include "rs_packets.h"
-#include "stg_logger.h"
+#include "stg/blowfish.h"
+#include "stg/rs_packets.h"
+#include "stg/logger.h"
struct UserData
{
struct UserData
{
@@
-56,7
+56,7
@@
struct AliveData : public UserData
class IsNotTimedOut : public std::unary_function<const AliveData &, bool> {
public:
class IsNotTimedOut : public std::unary_function<const AliveData &, bool> {
public:
- IsNotTimedOut(double to) : timeout(to), now(time(NULL)) {}
+
explicit
IsNotTimedOut(double to) : timeout(to), now(time(NULL)) {}
bool operator()(const AliveData & data) const
{
return difftime(now, data.lastAlive) < timeout;
bool operator()(const AliveData & data) const
{
return difftime(now, data.lastAlive) < timeout;
@@
-94,10
+94,9
@@
private:
// Networking stuff
bool PrepareNet();
bool FinalizeNet();
// Networking stuff
bool PrepareNet();
bool FinalizeNet();
- bool WaitPackets(int sd) const;
bool RecvPacket();
// Parsing stuff
bool RecvPacket();
// Parsing stuff
- bool CheckHeader(const RS
_
PACKET_HEADER & header) const;
+ bool CheckHeader(const RS
::
PACKET_HEADER & header) const;
bool GetParams(char * buffer, UserData & data);
// Processing stuff
void ProcessPending();
bool GetParams(char * buffer, UserData & data);
// Processing stuff
void ProcessPending();
@@
-106,7
+105,7
@@
private:
bool Connect(const UserData & data) const;
BLOWFISH_CTX ctxS;
bool Connect(const UserData & data) const;
BLOWFISH_CTX ctxS;
- STG
_LOGGER
& WriteServLog;
+ STG
::Logger
& WriteServLog;
mutable std::string errorStr;
std::string scriptOnConnect;
mutable std::string errorStr;
std::string scriptOnConnect;
@@
-134,7
+133,7
@@
private:
class DisconnectUser : public std::unary_function<const UserData &, void> {
public:
class DisconnectUser : public std::unary_function<const UserData &, void> {
public:
- DisconnectUser(LISTENER & l) : listener(l) {};
+
explicit
DisconnectUser(LISTENER & l) : listener(l) {};
void operator()(const UserData & data)
{
listener.Disconnect(data);
void operator()(const UserData & data)
{
listener.Disconnect(data);