|
server 0.0.1
basicserverinfrastructure
|
#include <stdlib.h>#include <errno.h>#include "socket.h"#include "interface/class.h"#include "interface/logger.h"
Go to the source code of this file.
Functions | |
| void | socketConnect (Sock this, const char *addr) |
| void socketConnect | ( | Sock | this, |
| const char * | addr | ||
| ) |
Definition at line 10 of file connect.c.
{
inet_pton(AF_INET, addr, &((this->addr).sin_addr));
(this->addr).sin_family = AF_INET; /* Internet address family */
(this->addr).sin_port = htons(this->port); /* Local port */
if (-1 == connect(this->handle, (struct sockaddr*) &(this->addr), sizeof(this->addr))) {
loggerLog(this->log, LOGGER_CRIT,
"error connection socket: %s - service terminated",
strerror(errno));
exit(EXIT_FAILURE);
}
}
