| 104 | } |
| 105 | |
| 106 | bool SocketAttr::connectTo() { |
| 107 | if (::connect(_fd, reinterpret_cast<sockaddr *>(&_addr), sizeof(_addr)) == -1) { |
| 108 | if (errno != ECONNREFUSED && errno != EINPROGRESS) { |
| 109 | PERROR("connect"); |
| 110 | } |
| 111 | return false; |
| 112 | } |
| 113 | return true; |
| 114 | } |
| 115 | |
| 116 | bool SocketAttr::acceptConnection(SocketClient &client, bool showLogInfo) { |
| 117 | // check if we have a client? |