--- libaitio/src/sock.c 2013/11/21 14:43:53 1.4.4.2 +++ libaitio/src/sock.c 2013/11/21 15:01:22 1.4.4.3 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: sock.c,v 1.4.4.2 2013/11/21 14:43:53 misho Exp $ +* $Id: sock.c,v 1.4.4.3 2013/11/21 15:01:22 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -322,4 +322,23 @@ ioLoopSocket(sock_t * __restrict s, sched_task_func_t { schedRead(s->sock_root, io_acceptClient, s, s->sock_fd, rcb, 0); return schedRun(s->sock_root, &s->sock_kill); +} + +/* + * ioCloseClient() - Close client socket + * + * @c = Client socket + * return: 0 ok or !=0 error + */ +int +ioCloseClient(sock_cli_t * __restrict c) +{ + sock_t *s; + + if (!c) + return -1; + else + s = c->cli_parent; + + return !schedEvent(s->sock_root, io_closeClient, c, 0, NULL, c->cli_fd); }