Created
December 12, 2009 09:03
-
-
Save oza/254821 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
extern "C"{ | |
#include <sys/socket.h> | |
} | |
using namespace std; | |
class WebServer | |
{ | |
public: | |
WebServer(string ip); | |
~WebServer(void); | |
void accept(void); | |
private: | |
string port; | |
int fd; | |
}; | |
WebServer::WebServer(string port) | |
{ | |
cout << "create:" << port << endl; | |
//bind(); | |
//listen | |
} | |
WebServer::~WebServer(void) | |
{ | |
//close(); | |
} | |
void WebServer::run(void) | |
{ | |
while(1){ | |
;//accept(); | |
} | |
} | |
int main() | |
{ | |
WebServer* ws = new WebServer("3333"); | |
ws->run(); | |
delete(ws); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: | |
g++ helloserver.cpp -o helloserver | |
clean: | |
server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment