epoll problem with tcp connect()

I am using epoll to manage my network connections. At the client side, the idea is to send the message upon detecting the completion of connect(). I've set up the socket to be nonblocking, then after calling of connect(), I add the socket into the epoll and wait on the event to be detected from epoll_wait. But I found there's no event returned at all. I was wondering if connect() will report event or not? Or my code has some problem? Thanks.

here is the part of my code:

    
if ((sockfd = socket(PF_INET, SOCK_STREAM, 0)) == -1) {
        perror("socket");
        exit(1);
    }

    printf(">>>client socket = %d   master ip=%s\n", sockfd, master_ip);
    setnonblocking(sockfd);

    bzero(&serv_addr, sizeof(serv_addr));
    serv_addr.sin_family = PF_INET;
    serv_addr.sin_port = htons(PORT);
    inet_aton(master_ip, &serv_addr.sin_addr);

    ret=connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(struct sockaddr));
    if(ret <0 ) {
        if(errno!=EINPROGRESS) {
            ret = lustre_event_add(sockfd, EPOLLIN | EPOLLET,
                    lustre_sendmsg_event_handler, (void *)NULL);
            if (ret) {
                fprintf(stderr, "lustre_event_add failed.\n");
                return;
            }
        }
        else
            sockfd=ret;
        perror("connect");
    }