diff options
Diffstat (limited to 'lib/network/socket.h')
| -rw-r--r-- | lib/network/socket.h | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/lib/network/socket.h b/lib/network/socket.h deleted file mode 100644 index 9ffc7a78..00000000 --- a/lib/network/socket.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef __socket_h -#define __socket_h - -#include <stdio.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <netdb.h> -#include <fcntl.h> - -#include <lib/base/ebase.h> -#include <lib/base/eerror.h> -#include <string> -#include <libsig_comp.h> -#include <lib/base/buffer.h> - -class eSocket: public Object -{ - int mystate; - int issocket; - unsigned int last_break; -private: - int socketdesc; - eIOBuffer readbuffer; - eIOBuffer writebuffer; - int writebusy; - sockaddr_in serv_addr; -protected: - ePtr<eSocketNotifier> rsn; - virtual void notifier(int); -public: - eSocket(eMainloop *ml); - eSocket(int socket, int issocket, eMainloop *ml); - ~eSocket(); - int connectToHost(std::string hostname, int port); - int getDescriptor(); - int writeBlock(const char *data, unsigned int len); - int setSocket(int socketfd, int issocket, eMainloop *ml); - int bytesToWrite(); - int readBlock(char *data, unsigned int maxlen); - int bytesAvailable(); - bool canReadLine(); - std::string readLine(); - void close(); - // flow control: start/stop data delivery into read buffer. - void enableRead(); - void disableRead(); - - void inject(const char *data, int len); - - enum State { Idle, HostLookup, Connecting, - Listening, Connection, Closing }; - int state(); - - Signal0<void> connectionClosed_; - Signal0<void> connected_; - Signal0<void> readyRead_; - Signal0<void> hangup; - Signal1<void,int> bytesWritten_; - Signal1<void,int> error_; -}; - -#endif /* __socket_h */ |
