Squid internals The comm interface (src/comm.c) Functions to manipulate socket FDs Bind to a given port commBind(s, in_addr, port) Create a socket sock = comm_open(sock_type, proto, addr, port, flags, desc) Listen on a socket comm_listen(sock) Set socket timeout handler commSetTimeout(fd, timeout, callback, callbackdata) Accept an incoming connection sock = comm_accept(fd, &peeraddr, &myaddr) Close a socket comm_close(fd) Set defer handler commSetDefer(fd, callback, callbackdata) Register for IO callback commSetSelect(fd, type, callback, callbackdata, timeout)