Skip to content

edisonlz/c_epoll_framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

c_epoll_framework

c epoll framework like tornado tcpserver

Need implement process_request

Example

void process_request(int client, int epoll_fd) {

    ssize_t count;
    char buf[4096];

    count = read_all(client, buf);

    #ifdef DEBUG
    printf("read all %s\n",buf);
    #endif

    echo(client, buf);
}


void echo(int client,char *buf){

    char *char_quit = "quit";
    int quit = strncmp(buf, char_quit , 4);

    if(quit == 0){
        buf = "quit!";
    }

    send_all(client , buf);

    /* quit */
    if(quit == 0){
        close(client);
    }

}

About

c epoll framework like tornado

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published