xref: /haiku/src/servers/app/drawing/interface/remote/NetReceiver.h (revision e5d65858f2361fe0552495b61620c84dcee6bc00)
1 /*
2  * Copyright 2009, Haiku, Inc.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Michael Lotz <mmlr@mlotz.ch>
7  */
8 #ifndef NET_RECEIVER_H
9 #define NET_RECEIVER_H
10 
11 #include <OS.h>
12 #include <SupportDefs.h>
13 
14 class BNetEndpoint;
15 class StreamingRingBuffer;
16 
17 class NetReceiver {
18 public:
19 								NetReceiver(BNetEndpoint *listener,
20 									StreamingRingBuffer *target);
21 								~NetReceiver();
22 
23 		BNetEndpoint *			Endpoint() { return fEndpoint; }
24 
25 private:
26 static	int32					_NetworkReceiverEntry(void *data);
27 		status_t				_NetworkReceiver();
28 
29 		BNetEndpoint *			fListener;
30 		StreamingRingBuffer *	fTarget;
31 
32 		thread_id				fReceiverThread;
33 		bool					fStopThread;
34 
35 		BNetEndpoint *			fEndpoint;
36 };
37 
38 #endif // NET_RECEIVER_H
39