/***********************************************************************/ /* Course: Computer Science 402a */ /* Assignment: Assignment 1 */ /* Instructor: Mark Giesbrecht */ /* Submitted by: Dan Fraser */ /* Student Number: 001219229 */ /* Due Date: Wednesday, February 16 */ /***********************************************************************/ /* StreamSocket.h - Interface for the StreamSocket wrapper class */ /***********************************************************************/ #ifndef _STREAMSOCKET_H_ #define _STREAMSOCKET_H_ //#include "Socket.h" #include #include #include #include #include #include #include #include #include class StreamSocket { public: StreamSocket(); virtual int send(void *, int length); virtual int send(string); virtual int send(int to, void *, int length); virtual int receive (void *, int length); virtual int receive (int from, void *, int length); virtual int connect(string hostname, int port); virtual int bind(int port = 0); virtual int listen(int qsize); virtual int accept(); virtual int disconnect(int socket = 0); virtual string remoteHost(); private: int sock; struct sockaddr_in server, remote; struct hostent *hp, *gethostbyname(); }; #endif