OSDN Git Service

2003-11-19 Andrew Cagney <cagney@redhat.com>
[pf3gnuchains/pf3gnuchains3x.git] / winsup / cygserver / cygserver_transport_sockets.h
1 /* cygserver_transport_sockets.h
2
3    Copyright 2001, 2002 Red Hat Inc.
4
5    Written by Robert Collins <rbtcollins@hotmail.com>
6
7 This file is part of Cygwin.
8
9 This software is a copyrighted work licensed under the terms of the
10 Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
11 details. */
12
13 #ifndef _CYGSERVER_TRANSPORT_SOCKETS_
14 #define _CYGSERVER_TRANSPORT_SOCKETS_
15
16 #include <sys/socket.h>
17 #include <sys/un.h>
18
19 class transport_layer_sockets : public transport_layer_base
20 {
21 public:
22 #ifndef __INSIDE_CYGWIN__
23   virtual int listen ();
24   virtual class transport_layer_sockets *accept (bool *recoverable);
25 #endif
26
27   virtual void close ();
28   virtual ssize_t read (void *buf, size_t len);
29   virtual ssize_t write (void *buf, size_t len);
30   virtual int connect ();
31
32   transport_layer_sockets ();
33   virtual ~transport_layer_sockets ();
34
35 private:
36   /* for socket based communications */
37   int _fd;
38   struct sockaddr_un _addr;
39   socklen_t _addr_len;
40   const bool _is_accepted_endpoint;
41   bool _is_listening_endpoint;
42
43   transport_layer_sockets (int fd);
44 };
45
46 #endif /* _CYGSERVER_TRANSPORT_SOCKETS_ */