Created
November 24, 2010 23:09
-
-
Save itissid/714606 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
void static closeOnComplete(struct evbuffer *buffer, | |
const struct evbuffer_cb_info *info, void *arg){ | |
struct total_processed *tp = (total_processed *)arg; | |
size_t towrite_n = tp->n; | |
size_t drained = info->n_deleted; | |
if(drained >= (towrite_n -1)){ | |
//close the socket connection... | |
cout<<"***Done with draining***"<<endl; | |
cout<<drained<<" out of "<<towrite_n<<" bytes drained"<<endl; | |
//HTF to free a connection... | |
bufferevent_free(tp->bev); | |
}else{ | |
cout<<"****WAIT FOR IT***"<<endl; | |
cout<<drained<<" out of "<<towrite_n<<" bytes drained"<<endl; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment