]>
Commit | Line | Data |
---|---|---|
282113ba | 1 | /* transport_sockets.h |
56797078 | 2 | |
1dcd520b | 3 | Copyright 2001, 2002, 2003 Red Hat Inc. |
56797078 CV |
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 | ||
282113ba CV |
13 | #ifndef _TRANSPORT_SOCKETS_H |
14 | #define _TRANSPORT_SOCKETS_H | |
56797078 CV |
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 | ||
282113ba | 46 | #endif /* _TRANSPORT_SOCKETS_H */ |