From 50bbfcc3c3c8028a1f3665968846f3294daf776b Mon Sep 17 00:00:00 2001 From: Brad Arant Date: Fri, 23 Jul 2021 16:42:50 -0700 Subject: [PATCH] Got it to compile. --- Socket.cpp | 2 +- TCPServer.cpp | 27 ++--- TCPServer.h | 6 +- html/Socket_8h_source.html | 8 +- html/TCPServer_8h_source.html | 100 +++++++++-------- html/TCPSession_8h_source.html | 93 ++++++++-------- html/classcore_1_1ConsoleServer-members.html | 6 +- html/classcore_1_1ConsoleServer.html | 18 ++-- html/classcore_1_1ConsoleSession-members.html | 2 - html/classcore_1_1ConsoleSession.html | 4 - html/classcore_1_1TCPServer-members.html | 6 +- html/classcore_1_1TCPServer.html | 101 ++++++++++++++++-- html/classcore_1_1TCPSession-members.html | 6 +- html/classcore_1_1TCPSession.html | 41 ------- html/classcore_1_1TLSServer-members.html | 2 + html/classcore_1_1TLSServer.html | 18 ++-- html/classcore_1_1TLSSession-members.html | 6 +- html/classcore_1_1TLSSession.html | 4 - .../classcore_1_1TerminalSession-members.html | 6 +- html/classcore_1_1TerminalSession.html | 4 - html/functions.html | 2 +- html/functions_func.html | 2 +- html/search/all_a.js | 2 +- html/search/functions_8.js | 2 +- latex/classcore_1_1TCPServer.tex | 35 ++++-- latex/classcore_1_1TCPSession.tex | 18 +--- 26 files changed, 271 insertions(+), 250 deletions(-) diff --git a/Socket.cpp b/Socket.cpp index ee2cc36..ca719e9 100644 --- a/Socket.cpp +++ b/Socket.cpp @@ -69,7 +69,7 @@ namespace core { return false; } - if(event.events & EPOLLIN) {} + if(event.events & EPOLLIN) { receiveData(buffer); } diff --git a/TCPServer.cpp b/TCPServer.cpp index edd57c2..9e622c6 100644 --- a/TCPServer.cpp +++ b/TCPServer.cpp @@ -1,5 +1,4 @@ #include "TCPServer.h" -#include "TCPService.h" #include "EPoll.h" #include "TCPSession.h" #include "Exception.h" @@ -16,7 +15,6 @@ namespace core { throw coreutils::Exception("Error on bind to socket: " + std::to_string(errno)); if(listen(getDescriptor(), 20) < 0) throw coreutils::Exception("Error on listen to socket"); - service = getService(ePoll); } TCPServer::~TCPServer() { @@ -60,10 +58,6 @@ namespace core { throw coreutils::Exception(errorString); } - TCPService * TCPServer::getService(EPoll &epoll) { - return new TCPService(epoll); - } - TCPSession * TCPServer::getSocketAccept(EPoll &ePoll) { return new TCPSession(ePoll, *this); } @@ -84,20 +78,19 @@ namespace core { return 1; } - void TCPSession::sendToAll() { - for(auto session : server.sessions) - if(session != this) - session->write(out.str()); - out.str(""); + void TCPServer::sendToAll(std::stringstream &data, TCPSession *sender) { + for(auto session : sessions) + if(session != sender) + session->write(data.str()); + data.str(""); } - void TCPSession::sendToAll(SessionFilter filter) { - for(auto session : server.sessions) + void TCPServer::sendToAll(std::stringstream &data, TCPSession *sender, SessionFilter &filter) { + for(auto session : sessions) if(filter.test(*session)) - if(session != this) - session->write(out.str()); - out.str(""); + if(session != sender) + session->write(data.str()); + data.str(""); } - } diff --git a/TCPServer.h b/TCPServer.h index 4cab2fe..ce1b42b 100644 --- a/TCPServer.h +++ b/TCPServer.h @@ -42,8 +42,6 @@ namespace core { ~TCPServer(); - void removeFromSessionList(TCPSession *session); - virtual void sessionErrorHandler(std::string errorString, std::stringstream &out); /// @@ -56,8 +54,6 @@ namespace core { virtual TCPSession * getSocketAccept(EPoll &epoll); - void output(TCPSession *session); /// 201 
Definition: Socket.h:34
-
int write(std::string data)
Definition: Socket.cpp:155
+
int write(std::string data)
Definition: Socket.cpp:145
Definition: EPoll.h:31
virtual void onRegistered()
Called after the socket has been registered with epoll processing.
Definition: Socket.cpp:55
-
virtual void onDataReceived(std::string data)
Called when data is received from the socket.
Definition: Socket.cpp:102
+
virtual void onDataReceived(std::string data)
Called when data is received from the socket.
Definition: Socket.cpp:92
Socket(EPoll &ePoll, std::string text="")
Definition: Socket.cpp:8
-
void shutdown(std::string text="unknown")
Definition: Socket.cpp:174
+
void shutdown(std::string text="unknown")
Definition: Socket.cpp:164
virtual void onRegister()
Called before the socket has registered with the epoll processing.
Definition: Socket.cpp:53
bool eventReceived(struct epoll_event event)
Parse epoll event and call specified callbacks.
Definition: Socket.cpp:61
virtual void onUnregistered()
Called when the socket has finished unregistering for the epoll processing.
Definition: Socket.cpp:59
-
virtual void receiveData(coreutils::ZString buffer)
Definition: Socket.cpp:110
+
virtual void receiveData(coreutils::ZString buffer)
Definition: Socket.cpp:100
Definition: Object.h:8
int getDescriptor()
Get the descriptor for the socket.
Definition: Socket.cpp:40
~Socket()
Definition: Socket.cpp:14
diff --git a/html/TCPServer_8h_source.html b/html/TCPServer_8h_source.html index 947add9..e50f483 100644 --- a/html/TCPServer_8h_source.html +++ b/html/TCPServer_8h_source.html @@ -81,68 +81,76 @@ $(function() {
25 
26  public:
27 
-
37 
-
38  TCPServer(EPoll &ePoll, IPAddress address, std::string text = "");
-
39 
-
43 
-
44  ~TCPServer();
-
45 
-
51 
- -
53 
-
59 
- -
61 
-
62  void removeFromSessionList(TCPSession *session);
-
63 
-
64  virtual void sessionErrorHandler(std::string errorString, std::stringstream &out);
-
65 
-
73 
-
74  virtual TCPSession * getSocketAccept(EPoll &epoll);
+
36 
+
37  TCPServer(EPoll &ePoll, IPAddress address, std::string text = "");
+
38 
+
42 
+
43  ~TCPServer();
+
44 
+
45  virtual void sessionErrorHandler(std::string errorString, std::stringstream &out);
+
46 
+
54 
+
55  virtual TCPSession * getSocketAccept(EPoll &epoll);
+
56 
+
60 
+
61  std::vector<TCPSession *> sessions;
+
62 
+
67 
+ +
69 
75 
-
76  void output(TCPSession *session);
+
77 
-
81 
-
82  std::vector<TCPSession *> sessions;
83 
-
88 
- -
90 
-
91  protected:
-
92 
-
102 
-
103  void onDataReceived(std::string data) override;
-
104 
-
111 
-
112  int processCommand(coreutils::ZString command, TCPSession *session, std::stringstream &data) override;
-
113 
-
114  private:
-
115 
-
116  TCPSession * accept();
-
117  std::mutex lock;
-
118 
-
119  };
-
120 
-
121 }
-
122 
-
123 #endif
+ +
85 
+
86  void removeFromSessionList(TCPSession *session);
+
87 
+
88  void output(TCPSession *session);
+
89 
+
90  protected:
+
91 
+
101 
+
102  void onDataReceived(std::string data) override;
+
103 
+
110 
+
111  int processCommand(coreutils::ZString command, TCPSession *session, std::stringstream &data) override;
+
112 
+
117 
+
118  void sendToAll(std::stringstream &out, TCPSession *sender, SessionFilter &filter);
+
119 
+
125 
+
126  void sendToAll(std::stringstream &out, TCPSession *sender);
+
127 
+
128  private:
+
129 
+
130  TCPSession * accept();
+
131  std::mutex lock;
+
132 
+
133  };
+
134 
+
135 }
+
136 
+
137 #endif
-
IPAddressList * blackList
Definition: TCPServer.h:52
+
Definition: SessionFilter.h:10
+
IPAddressList * blackList
Definition: TCPServer.h:76
Definition: TCPSession.h:24
Definition: IPAddress.h:9
-
std::vector< TCPSession * > sessions
Definition: TCPServer.h:82
+
void sendToAll(std::stringstream &out, TCPSession *sender, SessionFilter &filter)
Definition: TCPServer.cpp:88
+
std::vector< TCPSession * > sessions
Definition: TCPServer.h:61
void onDataReceived(std::string data) override
Definition: TCPServer.cpp:25
TCPServer(EPoll &ePoll, IPAddress address, std::string text="")
Definition: TCPServer.cpp:9
Definition: EPoll.h:31
int processCommand(coreutils::ZString command, TCPSession *session, std::stringstream &data) override
Definition: TCPServer.cpp:71
Definition: Command.h:22
Definition: TCPSocket.h:20
-
IPAddressList * whiteList
Definition: TCPServer.h:60
+
IPAddressList * whiteList
Definition: TCPServer.h:84
Definition: CommandList.h:18
Definition: IPAddressList.h:9
~TCPServer()
Definition: TCPServer.cpp:20
Definition: TCPServer.h:24
-
CommandList commands
Definition: TCPServer.h:89
+
CommandList commands
Definition: TCPServer.h:68
virtual TCPSession * getSocketAccept(EPoll &epoll)
Definition: TCPServer.cpp:61
void output(TCPSession *session)
Output the consoles array to the console.
Definition: TCPServer.cpp:65
diff --git a/html/TCPSession_8h_source.html b/html/TCPSession_8h_source.html index 48a5c9b..57ff11b 100644 --- a/html/TCPSession_8h_source.html +++ b/html/TCPSession_8h_source.html @@ -97,64 +97,55 @@ $(function() {
54 
55  void send();
56 
-
61 
-
62  void sendToAll();
-
63 
-
69 
-
70  void sendToAll(SessionFilter filter);
-
71 
-
75 
-
76  void terminate();
-
77 
-
81 
-
82  TCPServer &server;
+
60 
+
61  void terminate();
+
62 
+
66 
+
67  TCPServer &server;
+
68 
+
69  protected:
+
70 
+
74 
+
75  virtual void onRegistered() override;
+
76 
+
82  virtual void onDataReceived(coreutils::ZString data) override;
83 
-
84  protected:
-
85 
-
89 
-
90  virtual void onRegistered() override;
-
91 
-
97 
-
98  virtual void onDataReceived(coreutils::ZString data) override;
+
90 
+
91  virtual void onLineReceived(coreutils::ZString line);
+
92 
99 
-
106 
-
107  virtual void onLineReceived(coreutils::ZString line);
-
108 
-
115 
-
116  virtual void onBlockReceived(coreutils::ZString block);
-
117 
-
123 
-
124  virtual void onConnected();
-
125 
-
135 
-
136  virtual void protocol(coreutils::ZString data);
-
137 
-
143 
-
144  void setBlockSize(int size = 0);
-
145 
-
146  private:
-
147  char *lineBuffer = NULL;
-
148  int lineBufferSize = 0;
-
149  int lineLength = 0;
-
150  int blockLength = 0;
-
151  std::mutex mtx;
-
152  bool term = false;
-
153  int blockSize = 0;
-
154 
-
155  };
-
156 
-
157 }
-
158 
-
159 #endif
+
100  virtual void onBlockReceived(coreutils::ZString block);
+
101 
+
107 
+
108  virtual void onConnected();
+
109 
+
119 
+
120  virtual void protocol(coreutils::ZString data);
+
121 
+
127 
+
128  void setBlockSize(int size = 0);
+
129 
+
130  private:
+
131  char *lineBuffer = NULL;
+
132  int lineBufferSize = 0;
+
133  int lineLength = 0;
+
134  int blockLength = 0;
+
135  std::mutex mtx;
+
136  bool term = false;
+
137  int blockSize = 0;
+
138 
+
139  };
+
140 
+
141 }
+
142 
+
143 #endif
-
void send()
Definition: TCPSession.cpp:97
-
Definition: SessionFilter.h:10
+
void send()
Definition: TCPSession.cpp:82
Definition: TCPSession.h:24
Definition: EPoll.h:31
-
void sendToAll()
Definition: TCPSession.cpp:82
virtual void onDataReceived(coreutils::ZString data) override
Definition: TCPSession.cpp:33
std::stringstream out
Definition: TCPSession.h:48
-
void terminate()
Definition: TCPSession.cpp:103
+
void terminate()
Definition: TCPSession.cpp:88
virtual void onRegistered() override
Called after the socket has been registered with epoll processing.
Definition: TCPSession.cpp:23
virtual void protocol(coreutils::ZString data)
Definition: TCPSession.cpp:17
void setBlockSize(int size=0)
Definition: TCPSession.cpp:65
diff --git a/html/classcore_1_1ConsoleServer-members.html b/html/classcore_1_1ConsoleServer-members.html index fc0214f..20d762f 100644 --- a/html/classcore_1_1ConsoleServer-members.html +++ b/html/classcore_1_1ConsoleServer-members.html @@ -100,13 +100,15 @@ $(function() { receiveData(coreutils::ZString buffer)core::Socketprotectedvirtual removeFromSessionList(TCPSession *session) (defined in core::TCPServer)core::TCPServer reset (defined in core::Socket)core::Socket + sendToAll(std::stringstream &out, TCPSession *sender, SessionFilter &filter)core::TCPServerprotected + sendToAll(std::stringstream &out, TCPSession *sender)core::TCPServerprotected sessionErrorHandler(std::string errorString, std::stringstream &out) (defined in core::TCPServer)core::TCPServervirtual sessionscore::TCPServer setBufferSize(int length) (defined in core::Socket)core::Socketprotected setDescriptor(int descriptor)core::Socket setName(std::string name)core::Command - shutDown (defined in core::Socket)core::Socketprotected - shutdown(std::string text="unknown")core::Socket + shutdown(std::string text="unknown")core::Socket + shutDown (defined in core::Socket)core::Socketprotected Socket(EPoll &ePoll, std::string text="")core::Socket tag (defined in core::Object)core::Object tag (defined in core::Object)core::Object diff --git a/html/classcore_1_1ConsoleServer.html b/html/classcore_1_1ConsoleServer.html index 686a46e..dd94d4d 100644 --- a/html/classcore_1_1ConsoleServer.html +++ b/html/classcore_1_1ConsoleServer.html @@ -120,12 +120,12 @@ void logSend (std::str    ~TCPServer ()   - -void removeFromSessionList (TCPSession *session) -  virtual void sessionErrorHandler (std::string errorString, std::stringstream &out)   + +void removeFromSessionList (TCPSession *session) +  void output (TCPSession *session)  Output the consoles array to the console.
@@ -198,14 +198,14 @@ std::string getName ()

Additional Inherited Members

- Public Attributes inherited from core::TCPServer -IPAddressListblackList -  -IPAddressListwhiteList -  std::vector< TCPSession * > sessions   CommandList commands   +IPAddressListblackList +  +IPAddressListwhiteList- Public Attributes inherited from core::TCPSocket IPAddress ipAddress @@ -226,6 +226,10 @@ std::string tag  int processCommand (coreutils::ZString command, TCPSession *session, std::stringstream &data) override   +void sendToAll (std::stringstream &out, TCPSession *sender, SessionFilter &filter) +  +void sendToAll (std::stringstream &out, TCPSession *sender) +  - Protected Member Functions inherited from core::Socket void setBufferSize (int length) diff --git a/html/classcore_1_1ConsoleSession-members.html b/html/classcore_1_1ConsoleSession-members.html index b6e77e3..b7cbfb2 100644 --- a/html/classcore_1_1ConsoleSession-members.html +++ b/html/classcore_1_1ConsoleSession-members.html @@ -105,8 +105,6 @@ $(function() { saveCursor() (defined in core::TerminalSession)core::TerminalSession scrollArea(int start, int end) (defined in core::TerminalSession)core::TerminalSession send()core::TCPSession - sendToAll()core::TCPSession - sendToAll(SessionFilter filter)core::TCPSession server (defined in core::TCPSession)core::TCPSession setBackColor(int color) (defined in core::TerminalSession)core::TerminalSession setBlockSize(int size=0)core::TCPSessionprotected diff --git a/html/classcore_1_1ConsoleSession.html b/html/classcore_1_1ConsoleSession.html index a870a27..145d38e 100644 --- a/html/classcore_1_1ConsoleSession.html +++ b/html/classcore_1_1ConsoleSession.html @@ -158,10 +158,6 @@ void scrollArea (int s   void send ()   -void sendToAll () -  -void sendToAll (SessionFilter filter) -  void terminate ()   - Public Member Functions inherited from core::TCPSocket diff --git a/html/classcore_1_1TCPServer-members.html b/html/classcore_1_1TCPServer-members.html index 60a8487..3a1af50 100644 --- a/html/classcore_1_1TCPServer-members.html +++ b/html/classcore_1_1TCPServer-members.html @@ -98,13 +98,15 @@ $(function() { receiveData(coreutils::ZString buffer)core::Socketprotectedvirtual removeFromSessionList(TCPSession *session) (defined in core::TCPServer)core::TCPServer reset (defined in core::Socket)core::Socket + sendToAll(std::stringstream &out, TCPSession *sender, SessionFilter &filter)core::TCPServerprotected + sendToAll(std::stringstream &out, TCPSession *sender)core::TCPServerprotected sessionErrorHandler(std::string errorString, std::stringstream &out) (defined in core::TCPServer)core::TCPServervirtual sessionscore::TCPServer setBufferSize(int length) (defined in core::Socket)core::Socketprotected setDescriptor(int descriptor)core::Socket setName(std::string name)core::Command - shutDown (defined in core::Socket)core::Socketprotected - shutdown(std::string text="unknown")core::Socket + shutdown(std::string text="unknown")core::Socket + shutDown (defined in core::Socket)core::Socketprotected Socket(EPoll &ePoll, std::string text="")core::Socket tag (defined in core::Object)core::Object tag (defined in core::Object)core::Object diff --git a/html/classcore_1_1TCPServer.html b/html/classcore_1_1TCPServer.html index 69c0055..279bbfe 100644 --- a/html/classcore_1_1TCPServer.html +++ b/html/classcore_1_1TCPServer.html @@ -113,14 +113,14 @@ Public Member Functions    ~TCPServer ()   - -void removeFromSessionList (TCPSession *session) -  virtual void sessionErrorHandler (std::string errorString, std::stringstream &out)   virtual TCPSessiongetSocketAccept (EPoll &epoll)   + +void removeFromSessionList (TCPSession *session) +  void output (TCPSession *session)  Output the consoles array to the console.
@@ -192,14 +192,14 @@ std::string getName () - - - - + + + + @@ -222,6 +222,10 @@ Protected Member Functions + + + + @@ -282,7 +286,7 @@ bool 

Public Attributes

IPAddressListblackList
 
IPAddressListwhiteList
 
std::vector< TCPSession * > sessions
 
CommandList commands
 
IPAddressListblackList
 
IPAddressListwhiteList
 
- Public Attributes inherited from core::TCPSocket
IPAddress ipAddress
 
int processCommand (coreutils::ZString command, TCPSession *session, std::stringstream &data) override
 
void sendToAll (std::stringstream &out, TCPSession *sender, SessionFilter &filter)
 
void sendToAll (std::stringstream &out, TCPSession *sender)
 
- Protected Member Functions inherited from core::Socket
void setBufferSize (int length)
shutDown = false<
-

The constructor for the BMATCPSocket object.

+

The constructor for the TCPServer object.

Parameters
@@ -292,7 +296,6 @@ bool 
ePollthe EPoll instance that manages the socket.
shutDown = false<
-
Returns
the instance of the BMATCPServerSocket.
@@ -429,6 +432,86 @@ bool shutDown = false<

Reimplemented from core::Command.

+ + + +

◆ sendToAll() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void core::TCPServer::sendToAll (std::stringstream & out,
TCPSessionsender 
)
+
+protected
+
+

Use this sendToAll method to output the contents of the out stream to all the connections on the server excluding the sender session and the entries identified by the passed in filter object.

+ +
+
+ +

◆ sendToAll() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void core::TCPServer::sendToAll (std::stringstream & out,
TCPSessionsender,
SessionFilterfilter 
)
+
+protected
+
+

Use this sendToAll method to output the contents of the out stream to all the connections on the server excluding the sender session.

+

Member Data Documentation

diff --git a/html/classcore_1_1TCPSession-members.html b/html/classcore_1_1TCPSession-members.html index e4f6c07..4f3f9e4 100644 --- a/html/classcore_1_1TCPSession-members.html +++ b/html/classcore_1_1TCPSession-members.html @@ -96,14 +96,12 @@ $(function() { receiveData(coreutils::ZString buffer)core::Socketprotectedvirtual reset (defined in core::Socket)core::Socket send()core::TCPSession - sendToAll()core::TCPSession - sendToAll(SessionFilter filter)core::TCPSession server (defined in core::TCPSession)core::TCPSession setBlockSize(int size=0)core::TCPSessionprotected setBufferSize(int length) (defined in core::Socket)core::Socketprotected setDescriptor(int descriptor)core::Socket - shutDown (defined in core::Socket)core::Socketprotected - shutdown(std::string text="unknown")core::Socket + shutdown(std::string text="unknown")core::Socket + shutDown (defined in core::Socket)core::Socketprotected Socket(EPoll &ePoll, std::string text="")core::Socket tag (defined in core::Object)core::Object TCPSession(EPoll &ePoll, TCPServer &server, std::string text="") (defined in core::TCPSession)core::TCPSession diff --git a/html/classcore_1_1TCPSession.html b/html/classcore_1_1TCPSession.html index 41e1bd8..3ecfaec 100644 --- a/html/classcore_1_1TCPSession.html +++ b/html/classcore_1_1TCPSession.html @@ -117,10 +117,6 @@ Public Member Functions   void send ()   -void sendToAll () -  -void sendToAll (SessionFilter filter) -  void terminate ()   - Public Member Functions inherited from core::TCPSocket @@ -429,43 +425,6 @@ bool shutDown = false<

The send method is used to output the contents of the out stream to the session containing the stream.

-
- - -

◆ sendToAll() [1/2]

- -
-
- - - - - - - -
void core::TCPSession::sendToAll ()
-
-

Use this sendToAll method to output the contents of the out stream to all the connections on the server excluding the sender session.

- -
-
- -

◆ sendToAll() [2/2]

- -
-
- - - - - - - - -
void core::TCPSession::sendToAll (SessionFilter filter)
-
-

Use this sendToAll method to output the contents of the out stream to all the connections on the server excluding the sender session and the entries identified by the passed in filter object.

-
diff --git a/html/classcore_1_1TLSServer-members.html b/html/classcore_1_1TLSServer-members.html index cdc2421..c631ac0 100644 --- a/html/classcore_1_1TLSServer-members.html +++ b/html/classcore_1_1TLSServer-members.html @@ -100,6 +100,8 @@ $(function() { receiveData(coreutils::ZString buffer)core::Socketprotectedvirtual removeFromSessionList(TCPSession *session) (defined in core::TCPServer)core::TCPServer reset (defined in core::Socket)core::Socket + sendToAll(std::stringstream &out, TCPSession *sender, SessionFilter &filter)core::TCPServerprotected + sendToAll(std::stringstream &out, TCPSession *sender)core::TCPServerprotected sessionErrorHandler(std::string errorString, std::stringstream &out) (defined in core::TCPServer)core::TCPServervirtual sessionscore::TCPServer setBufferSize(int length) (defined in core::Socket)core::Socketprotected diff --git a/html/classcore_1_1TLSServer.html b/html/classcore_1_1TLSServer.html index b728594..570686a 100644 --- a/html/classcore_1_1TLSServer.html +++ b/html/classcore_1_1TLSServer.html @@ -120,14 +120,14 @@ Public Member Functions    ~TCPServer ()   - -void removeFromSessionList (TCPSession *session) -  virtual void sessionErrorHandler (std::string errorString, std::stringstream &out)   virtual TCPSessiongetSocketAccept (EPoll &epoll)   + +void removeFromSessionList (TCPSession *session) +  void output (TCPSession *session)  Output the consoles array to the console.
@@ -203,14 +203,14 @@ Public Attributes SSL_CTX * ctx   - Public Attributes inherited from core::TCPServer -IPAddressListblackList -  -IPAddressListwhiteList -  std::vector< TCPSession * > sessions   CommandList commands   +IPAddressListblackList +  +IPAddressListwhiteList- Public Attributes inherited from core::TCPSocket IPAddress ipAddress @@ -234,6 +234,10 @@ Additional Inherited Members   int processCommand (coreutils::ZString command, TCPSession *session, std::stringstream &data) override   +void sendToAll (std::stringstream &out, TCPSession *sender, SessionFilter &filter) +  +void sendToAll (std::stringstream &out, TCPSession *sender) +  - Protected Member Functions inherited from core::Socket void setBufferSize (int length) diff --git a/html/classcore_1_1TLSSession-members.html b/html/classcore_1_1TLSSession-members.html index 9ecf94c..a2e0a3b 100644 --- a/html/classcore_1_1TLSSession-members.html +++ b/html/classcore_1_1TLSSession-members.html @@ -96,14 +96,12 @@ $(function() { receiveData(coreutils::ZString buffer) overridecore::TLSSessionprotectedvirtual reset (defined in core::Socket)core::Socket send()core::TCPSession - sendToAll()core::TCPSession - sendToAll(SessionFilter filter)core::TCPSession server (defined in core::TCPSession)core::TCPSession setBlockSize(int size=0)core::TCPSessionprotected setBufferSize(int length) (defined in core::Socket)core::Socketprotected setDescriptor(int descriptor)core::Socket - shutdown(std::string text="unknown")core::Socket - shutDown (defined in core::Socket)core::Socketprotected + shutDown (defined in core::Socket)core::Socketprotected + shutdown(std::string text="unknown")core::Socket Socket(EPoll &ePoll, std::string text="")core::Socket tag (defined in core::Object)core::Object TCPSession(EPoll &ePoll, TCPServer &server, std::string text="") (defined in core::TCPSession)core::TCPSession diff --git a/html/classcore_1_1TLSSession.html b/html/classcore_1_1TLSSession.html index 13e5777..377843e 100644 --- a/html/classcore_1_1TLSSession.html +++ b/html/classcore_1_1TLSSession.html @@ -121,10 +121,6 @@ Public Member Functions   void send ()   -void sendToAll () -  -void sendToAll (SessionFilter filter) -  void terminate ()   - Public Member Functions inherited from core::TCPSocket diff --git a/html/classcore_1_1TerminalSession-members.html b/html/classcore_1_1TerminalSession-members.html index 0999c39..eb18746 100644 --- a/html/classcore_1_1TerminalSession-members.html +++ b/html/classcore_1_1TerminalSession-members.html @@ -104,8 +104,6 @@ $(function() { saveCursor() (defined in core::TerminalSession)core::TerminalSession scrollArea(int start, int end) (defined in core::TerminalSession)core::TerminalSession send()core::TCPSession - sendToAll()core::TCPSession - sendToAll(SessionFilter filter)core::TCPSession server (defined in core::TCPSession)core::TCPSession setBackColor(int color) (defined in core::TerminalSession)core::TerminalSession setBlockSize(int size=0)core::TCPSessionprotected @@ -113,8 +111,8 @@ $(function() { setColor(int color) (defined in core::TerminalSession)core::TerminalSession setCursorLocation(int x, int y)core::TerminalSession setDescriptor(int descriptor)core::Socket - shutdown(std::string text="unknown")core::Socket - shutDown (defined in core::Socket)core::Socketprotected + shutDown (defined in core::Socket)core::Socketprotected + shutdown(std::string text="unknown")core::Socket Socket(EPoll &ePoll, std::string text="")core::Socket tag (defined in core::Object)core::Object TCPSession(EPoll &ePoll, TCPServer &server, std::string text="") (defined in core::TCPSession)core::TCPSession diff --git a/html/classcore_1_1TerminalSession.html b/html/classcore_1_1TerminalSession.html index eadcabc..8239bc1 100644 --- a/html/classcore_1_1TerminalSession.html +++ b/html/classcore_1_1TerminalSession.html @@ -147,10 +147,6 @@ void scrollArea (int s   void send ()   -void sendToAll () -  -void sendToAll (SessionFilter filter) -  void terminate ()   - Public Member Functions inherited from core::TCPSocket diff --git a/html/functions.html b/html/functions.html index ed81b8e..663f27b 100644 --- a/html/functions.html +++ b/html/functions.html @@ -229,7 +229,7 @@ $(function() { : core::TCPSession
  • sendToAll() -: core::TCPSession +: core::TCPServer
  • sessions : core::TCPServer diff --git a/html/functions_func.html b/html/functions_func.html index f4ae7e2..3338e60 100644 --- a/html/functions_func.html +++ b/html/functions_func.html @@ -208,7 +208,7 @@ $(function() { : core::TCPSession
  • sendToAll() -: core::TCPSession +: core::TCPServer
  • setBlockSize() : core::TCPSession diff --git a/html/search/all_a.js b/html/search/all_a.js index fe0403a..5d21b01 100644 --- a/html/search/all_a.js +++ b/html/search/all_a.js @@ -1,7 +1,7 @@ var searchData= [ ['send_42',['send',['../classcore_1_1TCPSession.html#a2b09eeafef5e44009a77d9da43e3b889',1,'core::TCPSession']]], - ['sendtoall_43',['sendToAll',['../classcore_1_1TCPSession.html#afdfe135694c6689f5365fac6c090ec33',1,'core::TCPSession::sendToAll()'],['../classcore_1_1TCPSession.html#a05c489dcd2ebd74f527864759929e351',1,'core::TCPSession::sendToAll(SessionFilter filter)']]], + ['sendtoall_43',['sendToAll',['../classcore_1_1TCPServer.html#a151f29593c0d1fa998e2b86b19c631f4',1,'core::TCPServer::sendToAll(std::stringstream &out, TCPSession *sender, SessionFilter &filter)'],['../classcore_1_1TCPServer.html#aa225cd2b704167ff22503e1897fe538f',1,'core::TCPServer::sendToAll(std::stringstream &out, TCPSession *sender)']]], ['sessionfilter_44',['SessionFilter',['../classcore_1_1SessionFilter.html',1,'core']]], ['sessions_45',['sessions',['../classcore_1_1TCPServer.html#aeed1bc55d099667ccda51cd682bfc633',1,'core::TCPServer']]], ['setblocksize_46',['setBlockSize',['../classcore_1_1TCPSession.html#a836fb3fd5ee543ebc93262a980ae88b5',1,'core::TCPSession']]], diff --git a/html/search/functions_8.js b/html/search/functions_8.js index 0086795..bb4769e 100644 --- a/html/search/functions_8.js +++ b/html/search/functions_8.js @@ -1,7 +1,7 @@ var searchData= [ ['send_124',['send',['../classcore_1_1TCPSession.html#a2b09eeafef5e44009a77d9da43e3b889',1,'core::TCPSession']]], - ['sendtoall_125',['sendToAll',['../classcore_1_1TCPSession.html#afdfe135694c6689f5365fac6c090ec33',1,'core::TCPSession::sendToAll()'],['../classcore_1_1TCPSession.html#a05c489dcd2ebd74f527864759929e351',1,'core::TCPSession::sendToAll(SessionFilter filter)']]], + ['sendtoall_125',['sendToAll',['../classcore_1_1TCPServer.html#a151f29593c0d1fa998e2b86b19c631f4',1,'core::TCPServer::sendToAll(std::stringstream &out, TCPSession *sender, SessionFilter &filter)'],['../classcore_1_1TCPServer.html#aa225cd2b704167ff22503e1897fe538f',1,'core::TCPServer::sendToAll(std::stringstream &out, TCPSession *sender)']]], ['setblocksize_126',['setBlockSize',['../classcore_1_1TCPSession.html#a836fb3fd5ee543ebc93262a980ae88b5',1,'core::TCPSession']]], ['setcursorlocation_127',['setCursorLocation',['../classcore_1_1TerminalSession.html#aa9939cbe36c08e1a0b8413a96ca251fa',1,'core::TerminalSession']]], ['setdescriptor_128',['setDescriptor',['../classcore_1_1Socket.html#ac44f6ae3196a8a3e09a6a85fcf495762',1,'core::Socket']]], diff --git a/latex/classcore_1_1TCPServer.tex b/latex/classcore_1_1TCPServer.tex index 32d375d..70cfa30 100644 --- a/latex/classcore_1_1TCPServer.tex +++ b/latex/classcore_1_1TCPServer.tex @@ -29,27 +29,27 @@ Collaboration diagram for core\+::T\+C\+P\+Server\+:\nopagebreak \item \mbox{\hyperlink{classcore_1_1TCPServer_a7ccdc057c9eee8504fce796301f82088}{$\sim$\+T\+C\+P\+Server}} () \item -\mbox{\Hypertarget{classcore_1_1TCPServer_a88c603cd5df9dbc1632fd4b5e164d75b}\label{classcore_1_1TCPServer_a88c603cd5df9dbc1632fd4b5e164d75b}} -void {\bfseries remove\+From\+Session\+List} (\mbox{\hyperlink{classcore_1_1TCPSession}{T\+C\+P\+Session}} $\ast$session) -\item \mbox{\Hypertarget{classcore_1_1TCPServer_a554ec6e67d368e7bb545d95635c0a0df}\label{classcore_1_1TCPServer_a554ec6e67d368e7bb545d95635c0a0df}} virtual void {\bfseries session\+Error\+Handler} (std\+::string error\+String, std\+::stringstream \&out) \item virtual \mbox{\hyperlink{classcore_1_1TCPSession}{T\+C\+P\+Session}} $\ast$ \mbox{\hyperlink{classcore_1_1TCPServer_a841f02799ad8529aad7cea132f4de8a9}{get\+Socket\+Accept}} (\mbox{\hyperlink{classcore_1_1EPoll}{E\+Poll}} \&epoll) \item +\mbox{\Hypertarget{classcore_1_1TCPServer_a88c603cd5df9dbc1632fd4b5e164d75b}\label{classcore_1_1TCPServer_a88c603cd5df9dbc1632fd4b5e164d75b}} +void {\bfseries remove\+From\+Session\+List} (\mbox{\hyperlink{classcore_1_1TCPSession}{T\+C\+P\+Session}} $\ast$session) +\item \mbox{\Hypertarget{classcore_1_1TCPServer_a120d5031360cc62251bdc43fa2d9813a}\label{classcore_1_1TCPServer_a120d5031360cc62251bdc43fa2d9813a}} void \mbox{\hyperlink{classcore_1_1TCPServer_a120d5031360cc62251bdc43fa2d9813a}{output}} (\mbox{\hyperlink{classcore_1_1TCPSession}{T\+C\+P\+Session}} $\ast$session) \begin{DoxyCompactList}\small\item\em Output the consoles array to the console. \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsection*{Public Attributes} \begin{DoxyCompactItemize} \item -\mbox{\hyperlink{classcore_1_1IPAddressList}{I\+P\+Address\+List}} $\ast$ \mbox{\hyperlink{classcore_1_1TCPServer_a82f6bf16e4ab20d8b30da09e034fffff}{black\+List}} -\item -\mbox{\hyperlink{classcore_1_1IPAddressList}{I\+P\+Address\+List}} $\ast$ \mbox{\hyperlink{classcore_1_1TCPServer_abad6300b6234ca8b69cef9128755342e}{white\+List}} -\item std\+::vector$<$ \mbox{\hyperlink{classcore_1_1TCPSession}{T\+C\+P\+Session}} $\ast$ $>$ \mbox{\hyperlink{classcore_1_1TCPServer_aeed1bc55d099667ccda51cd682bfc633}{sessions}} \item \mbox{\hyperlink{classcore_1_1CommandList}{Command\+List}} \mbox{\hyperlink{classcore_1_1TCPServer_afcc44802b988e2f4292504e804dccf8b}{commands}} +\item +\mbox{\hyperlink{classcore_1_1IPAddressList}{I\+P\+Address\+List}} $\ast$ \mbox{\hyperlink{classcore_1_1TCPServer_a82f6bf16e4ab20d8b30da09e034fffff}{black\+List}} +\item +\mbox{\hyperlink{classcore_1_1IPAddressList}{I\+P\+Address\+List}} $\ast$ \mbox{\hyperlink{classcore_1_1TCPServer_abad6300b6234ca8b69cef9128755342e}{white\+List}} \end{DoxyCompactItemize} \doxysubsection*{Protected Member Functions} \begin{DoxyCompactItemize} @@ -57,6 +57,10 @@ std\+::vector$<$ \mbox{\hyperlink{classcore_1_1TCPSession}{T\+C\+P\+Session}} $\ void \mbox{\hyperlink{classcore_1_1TCPServer_a276ccbc8cb9b4380ebd78807b97f0159}{on\+Data\+Received}} (std\+::string data) override \item int \mbox{\hyperlink{classcore_1_1TCPServer_ad08e04a2ff44c9c40419cdc6bd0e4b79}{process\+Command}} (coreutils\+::\+Z\+String command, \mbox{\hyperlink{classcore_1_1TCPSession}{T\+C\+P\+Session}} $\ast$session, std\+::stringstream \&data) override +\item +void \mbox{\hyperlink{classcore_1_1TCPServer_a151f29593c0d1fa998e2b86b19c631f4}{send\+To\+All}} (std\+::stringstream \&out, \mbox{\hyperlink{classcore_1_1TCPSession}{T\+C\+P\+Session}} $\ast$sender, \mbox{\hyperlink{classcore_1_1SessionFilter}{Session\+Filter}} \&filter) +\item +void \mbox{\hyperlink{classcore_1_1TCPServer_aa225cd2b704167ff22503e1897fe538f}{send\+To\+All}} (std\+::stringstream \&out, \mbox{\hyperlink{classcore_1_1TCPSession}{T\+C\+P\+Session}} $\ast$sender) \end{DoxyCompactItemize} \doxysubsection*{Additional Inherited Members} @@ -77,7 +81,7 @@ This object extends the B\+M\+A\+Command object as well so it can be added to a \doxysubsubsection{\texorpdfstring{TCPServer()}{TCPServer()}} {\footnotesize\ttfamily core\+::\+T\+C\+P\+Server\+::\+T\+C\+P\+Server (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classcore_1_1EPoll}{E\+Poll}} \&}]{e\+Poll, }\item[{\mbox{\hyperlink{classcore_1_1IPAddress}{I\+P\+Address}}}]{address, }\item[{std\+::string}]{text = {\ttfamily \char`\"{}\char`\"{}} }\end{DoxyParamCaption})} -The constructor for the B\+M\+A\+T\+C\+P\+Socket object. +The constructor for the \mbox{\hyperlink{classcore_1_1TCPServer}{T\+C\+P\+Server}} object. \begin{DoxyParams}{Parameters} @@ -90,9 +94,6 @@ The constructor for the B\+M\+A\+T\+C\+P\+Socket object. {\em command\+Name} & the name of the command used to invoke the status display for this object. \\ \hline \end{DoxyParams} -\begin{DoxyReturn}{Returns} -the instance of the B\+M\+A\+T\+C\+P\+Server\+Socket. -\end{DoxyReturn} \mbox{\Hypertarget{classcore_1_1TCPServer_a7ccdc057c9eee8504fce796301f82088}\label{classcore_1_1TCPServer_a7ccdc057c9eee8504fce796301f82088}} \index{core::TCPServer@{core::TCPServer}!````~TCPServer@{$\sim$TCPServer}} \index{````~TCPServer@{$\sim$TCPServer}!core::TCPServer@{core::TCPServer}} @@ -148,7 +149,19 @@ This method is called when the \mbox{\hyperlink{classcore_1_1Command}{Command}} Reimplemented from \mbox{\hyperlink{classcore_1_1Command_ad8eecee5b179a0030d2f34bcfa30d4f4}{core\+::\+Command}}. +\mbox{\Hypertarget{classcore_1_1TCPServer_aa225cd2b704167ff22503e1897fe538f}\label{classcore_1_1TCPServer_aa225cd2b704167ff22503e1897fe538f}} +\index{core::TCPServer@{core::TCPServer}!sendToAll@{sendToAll}} +\index{sendToAll@{sendToAll}!core::TCPServer@{core::TCPServer}} +\doxysubsubsection{\texorpdfstring{sendToAll()}{sendToAll()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}} +{\footnotesize\ttfamily void core\+::\+T\+C\+P\+Server\+::send\+To\+All (\begin{DoxyParamCaption}\item[{std\+::stringstream \&}]{out, }\item[{\mbox{\hyperlink{classcore_1_1TCPSession}{T\+C\+P\+Session}} $\ast$}]{sender }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [protected]}} +Use this send\+To\+All method to output the contents of the out stream to all the connections on the server excluding the sender session and the entries identified by the passed in filter object. \mbox{\Hypertarget{classcore_1_1TCPServer_a151f29593c0d1fa998e2b86b19c631f4}\label{classcore_1_1TCPServer_a151f29593c0d1fa998e2b86b19c631f4}} +\index{core::TCPServer@{core::TCPServer}!sendToAll@{sendToAll}} +\index{sendToAll@{sendToAll}!core::TCPServer@{core::TCPServer}} +\doxysubsubsection{\texorpdfstring{sendToAll()}{sendToAll()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}} +{\footnotesize\ttfamily void core\+::\+T\+C\+P\+Server\+::send\+To\+All (\begin{DoxyParamCaption}\item[{std\+::stringstream \&}]{out, }\item[{\mbox{\hyperlink{classcore_1_1TCPSession}{T\+C\+P\+Session}} $\ast$}]{sender, }\item[{\mbox{\hyperlink{classcore_1_1SessionFilter}{Session\+Filter}} \&}]{filter }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [protected]}} + +Use this send\+To\+All method to output the contents of the out stream to all the connections on the server excluding the sender session. \doxysubsection{Member Data Documentation} \mbox{\Hypertarget{classcore_1_1TCPServer_a82f6bf16e4ab20d8b30da09e034fffff}\label{classcore_1_1TCPServer_a82f6bf16e4ab20d8b30da09e034fffff}} diff --git a/latex/classcore_1_1TCPSession.tex b/latex/classcore_1_1TCPSession.tex index c7b5e74..15fb49d 100644 --- a/latex/classcore_1_1TCPSession.tex +++ b/latex/classcore_1_1TCPSession.tex @@ -32,10 +32,6 @@ virtual void \mbox{\hyperlink{classcore_1_1TCPSession_a50037cbfc515650e04054e548 \item void \mbox{\hyperlink{classcore_1_1TCPSession_a2b09eeafef5e44009a77d9da43e3b889}{send}} () \item -void \mbox{\hyperlink{classcore_1_1TCPSession_afdfe135694c6689f5365fac6c090ec33}{send\+To\+All}} () -\item -void \mbox{\hyperlink{classcore_1_1TCPSession_a05c489dcd2ebd74f527864759929e351}{send\+To\+All}} (\mbox{\hyperlink{classcore_1_1SessionFilter}{Session\+Filter}} filter) -\item void \mbox{\hyperlink{classcore_1_1TCPSession_a34936745e8d7669d5400e78d353a56d3}{terminate}} () \end{DoxyCompactItemize} \doxysubsection*{Public Attributes} @@ -136,19 +132,7 @@ Reimplemented in \mbox{\hyperlink{classcore_1_1TLSSession_a2ff61cfcb3ffd3593b1bf \doxysubsubsection{\texorpdfstring{send()}{send()}} {\footnotesize\ttfamily void core\+::\+T\+C\+P\+Session\+::send (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} -The send method is used to output the contents of the out stream to the session containing the stream. \mbox{\Hypertarget{classcore_1_1TCPSession_afdfe135694c6689f5365fac6c090ec33}\label{classcore_1_1TCPSession_afdfe135694c6689f5365fac6c090ec33}} -\index{core::TCPSession@{core::TCPSession}!sendToAll@{sendToAll}} -\index{sendToAll@{sendToAll}!core::TCPSession@{core::TCPSession}} -\doxysubsubsection{\texorpdfstring{sendToAll()}{sendToAll()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}} -{\footnotesize\ttfamily void core\+::\+T\+C\+P\+Session\+::send\+To\+All (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} - -Use this send\+To\+All method to output the contents of the out stream to all the connections on the server excluding the sender session. \mbox{\Hypertarget{classcore_1_1TCPSession_a05c489dcd2ebd74f527864759929e351}\label{classcore_1_1TCPSession_a05c489dcd2ebd74f527864759929e351}} -\index{core::TCPSession@{core::TCPSession}!sendToAll@{sendToAll}} -\index{sendToAll@{sendToAll}!core::TCPSession@{core::TCPSession}} -\doxysubsubsection{\texorpdfstring{sendToAll()}{sendToAll()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}} -{\footnotesize\ttfamily void core\+::\+T\+C\+P\+Session\+::send\+To\+All (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classcore_1_1SessionFilter}{Session\+Filter}}}]{filter }\end{DoxyParamCaption})} - -Use this send\+To\+All method to output the contents of the out stream to all the connections on the server excluding the sender session and the entries identified by the passed in filter object. \mbox{\Hypertarget{classcore_1_1TCPSession_a836fb3fd5ee543ebc93262a980ae88b5}\label{classcore_1_1TCPSession_a836fb3fd5ee543ebc93262a980ae88b5}} +The send method is used to output the contents of the out stream to the session containing the stream. \mbox{\Hypertarget{classcore_1_1TCPSession_a836fb3fd5ee543ebc93262a980ae88b5}\label{classcore_1_1TCPSession_a836fb3fd5ee543ebc93262a980ae88b5}} \index{core::TCPSession@{core::TCPSession}!setBlockSize@{setBlockSize}} \index{setBlockSize@{setBlockSize}!core::TCPSession@{core::TCPSession}} \doxysubsubsection{\texorpdfstring{setBlockSize()}{setBlockSize()}}