Annotation of fam/fam/TCP_Client.h, Revision 1.1
1.1 ! trev 1: // Copyright (C) 1999 Silicon Graphics, Inc. All Rights Reserved.
! 2: //
! 3: // This program is free software; you can redistribute it and/or modify it
! 4: // under the terms of version 2 of the GNU General Public License as
! 5: // published by the Free Software Foundation.
! 6: //
! 7: // This program is distributed in the hope that it would be useful, but
! 8: // WITHOUT ANY WARRANTY; without even the implied warranty of
! 9: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Further, any
! 10: // license provided herein, whether implied or otherwise, is limited to
! 11: // this program in accordance with the express provisions of the GNU
! 12: // General Public License. Patent licenses, if any, provided herein do not
! 13: // apply to combinations of this program with other product or programs, or
! 14: // any other product whatsoever. This program is distributed without any
! 15: // warranty that the program is delivered free of the rightful claim of any
! 16: // third person by way of infringement or the like. See the GNU General
! 17: // Public License for more details.
! 18: //
! 19: // You should have received a copy of the GNU General Public License along
! 20: // with this program; if not, write the Free Software Foundation, Inc., 59
! 21: // Temple Place - Suite 330, Boston MA 02111-1307, USA.
! 22:
! 23: #ifndef TCP_Client_included
! 24: #define TCP_Client_included
! 25:
! 26: #include "ClientConnection.h"
! 27: #include "MxClient.h"
! 28: #include "Set.h"
! 29: #include "Cred.h"
! 30:
! 31: struct sockaddr_un;
! 32:
! 33: // A TCP_Client is a client that connects to fam using the TCP/IP
! 34: // protocol. This class implements the fam protocol, and it also
! 35: // handles I/O buffering.
! 36: //
! 37: // The order of TCP_Client's fields has been optimized. The
! 38: // connection is next to last because it contains big buffers, and
! 39: // the ends of the buffers will rarely be accessed. The Activity
! 40: // is last because it is never accessed.
! 41:
! 42: class TCP_Client : public MxClient {
! 43:
! 44: public:
! 45:
! 46: TCP_Client(in_addr host, int fd, Cred &cred);
! 47: ~TCP_Client();
! 48:
! 49: bool ready_for_events();
! 50: void post_event(const Event&, Request, const char *name);
! 51: void enqueue_for_scan(Interest *);
! 52: void dequeue_from_scan(Interest *);
! 53: virtual void enqueue_scanner(Scanner *);
! 54: virtual void suggest_insecure_compat(const char *path);
! 55:
! 56: void send_sockaddr_un(sockaddr_un &sun) { conn.send_sockaddr_un(sun); }
! 57:
! 58: protected:
! 59: Cred cred; // if !is_valid, we believe the uid/gid in each client request.
! 60:
! 61: private:
! 62:
! 63: Set<Interest *> to_be_scanned;
! 64: Scanner *my_scanner;
! 65: ClientConnection conn;
! 66: Activity a; // simply declaring it activates timer.
! 67: bool insecure_compat_suggested;
! 68:
! 69: bool input_msg(const char *msg, int size);
! 70:
! 71: static bool input_handler(const char *msg, unsigned nbytes, void *closure);
! 72: static void unblock_handler(void *closure);
! 73:
! 74: };
! 75:
! 76: #endif /* !TCP_Client_included */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>