Lines Matching defs:sockfd
30 int sockfd = socket(AF_INET, SOCK_STREAM, 0);
31 if (sockfd < 0) {
37 if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(int)) < 0) {
42 this->setNonBlocking(sockfd);
44 //SkDebugf("Opened fd:%d\n", sockfd);
46 return sockfd;
49 void SkSocket::closeSocket(int sockfd) {
53 close(sockfd);
54 //SkDebugf("Closed fd:%d\n", sockfd);
56 if (FD_ISSET(sockfd, &fMasterSet)) {
57 FD_CLR(sockfd, &fMasterSet);
58 if (sockfd >= fMaxfd) {
67 void SkSocket::onFailedConnection(int sockfd) {
68 this->closeSocket(sockfd);
71 void SkSocket::setNonBlocking(int sockfd) {
72 int flags = fcntl(sockfd, F_GETFL);
73 fcntl(sockfd, F_SETFL, flags | O_NONBLOCK);
76 void SkSocket::addToMasterSet(int sockfd) {
77 FD_SET(sockfd, &fMasterSet);
78 if (sockfd > fMaxfd)
79 fMaxfd = sockfd;
329 void SkTCPClient::onFailedConnection(int sockfd) { //cleanup and recreate socket
330 SkASSERT(sockfd == fSockfd);