FrontPage|FindPage|TitleIndex|RecentChanges|RSS source_echo.cc2
 
/* ----------------------------------------------------------

 echo.cc by biscuit@actoz.com 
 for Linux 2.6.x

 v2.0 06/24/2004 first release
     - setrlimit, getrlimit Γί°‘
     - TEpollSocket.Idle Γί°‘

---------------------------------------------------------- */
#include <sys/resource.h>
#include "epsocket.h"
#include "epbasic.h"

#define WANT_MAX_CLIENT 10000

int main(void)
{
    int n, max_client;
    struct rlimit rlim;

    getrlimit(RLIMIT_NOFILE, &rlim);
    rlim.rlim_cur = WANT_MAX_CLIENT;

    setrlimit(RLIMIT_NOFILE, &rlim);
    getrlimit(RLIMIT_NOFILE, &rlim);

    max_client = rlim.rlim_cur;
    cout << "MAX_NOFILE : " << max_client << endl;

    TEpollSocket<TBasicClient> esock(max_client);

    esock.Listen(8000);

    for(;;){
        esock.Do(500);
        esock.Idle();
    }
}  

last modified 2004-06-24 12:35:34
EditText|FindPage|DeletePage|LikePages|