| 22 | } |
| 23 | |
| 24 | MessageServer::MessageServer(sockaddr_un& address, socklen_t len){ |
| 25 | sock.fd = socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0); |
| 26 | assert(sock.fd > 0); |
| 27 | |
| 28 | int e = bind(sock.fd, (sockaddr*)&address, len); |
| 29 | |
| 30 | if(e){ |
| 31 | perror("Bind: "); |
| 32 | close(sock.fd); |
| 33 | assert(!e); |
| 34 | } |
| 35 | |
| 36 | e = listen(sock.fd, 16); |
| 37 | |
| 38 | if(e){ |
| 39 | perror("Listen: "); |
| 40 | close(sock.fd); |
| 41 | assert(!e); |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | void MessageClient::Connect(sockaddr_un& address, socklen_t len){ |
| 46 | int e = connect(sock.fd, (sockaddr*)&address, len); |
nothing calls this directly
no outgoing calls
no test coverage detected