1 #ifndef __BMASocket_h__ 2 #define __BMASocket_h__ 7 #include "BMAProperty.h" 47 int & operator = (
const int &i) {
return value = i; }
48 operator int ()
const {
return value; }
68 void write(std::string data);
69 void write(
char *buffer,
int length);
71 void output(std::stringstream &out);
95 bool shutDown =
false;
97 void setBufferSize(
int length);
107 virtual void onTLSInit();
132 virtual void receiveData(
char *buffer,
int bufferLength);
139 struct epoll_event event;
150 void resetReadWrite(
int x);
174 std::queue<std::string> fifo;
Definition: BMASocket.h:31
void eventReceived(struct epoll_event event)
Parse epoll event and call specified callbacks.
Definition: BMASocket.cpp:46
virtual void onConnected()
Called when socket is open and ready to communicate.
Definition: BMASocket.cpp:116
int getDescriptor()
Get the descriptor for the socket.
Definition: BMASocket.cpp:27
virtual void onUnregistered()
Called when the socket has finished unregistering for the epoll processing.
Definition: BMASocket.cpp:42
Definition: BMAEPoll.h:29
virtual void onRegistered()
Called when the socket has finished registering with the epoll processing.
Definition: BMASocket.cpp:38
void write(std::string data)
Definition: BMASocket.cpp:129
void setDescriptor(int descriptor)
Set the descriptor for the socket.
Definition: BMASocket.cpp:19
void enable(bool mode)
Enable the socket to read or write based upon buffer.
Definition: BMASocket.cpp:72
virtual void receiveData(char *buffer, int bufferLength)
Definition: BMASocket.cpp:84
Definition: BMAObject.h:6
virtual void onDataReceived(std::string data)=0
Called when data is received from the socket.