2 // Copyright 2005 The Android Open Source Project
4 // Create or attach to a named bi-directional channel on the local machine.
6 #ifndef __LIBS_LOCALBICHANNEL_H
7 #define __LIBS_LOCALBICHANNEL_H
10 #error DO NOT USE THIS FILE IN THE DEVICE BUILD
18 * This is essentially a wrapper class for UNIX-domain sockets. The
19 * idea is to set one up with create() or attach to one with attach()
20 * and then extract the unidirectional read/write Pipes. These can
21 * be used directly or stuffed into a MessageStream.
23 * The name for the pipe should be a short filename made up of alphanumeric
24 * characters. Depending on the implementation, we may create a file in
25 * /tmp with the specified name, removing any existing copy.
27 class LocalBiChannel {
30 ~LocalBiChannel(void);
32 /* create the "listen" side */
33 bool create(const char* name);
36 * Listen for a connection. When we get one, we create unidirectional
37 * read/write pipes and return them.
39 bool listen(Pipe** ppReadPipe, Pipe** ppWritePipe);
42 * Attach to a channel created by somebody else. Returns pipes.
44 bool attach(const char* name, Pipe** ppReadPipe, Pipe** ppWritePipe);
49 unsigned long mHandle;
52 }; // namespace android
54 #endif // __LIBS_LOCALBICHANNEL_H