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 14class BNetEndpoint; 15class StreamingRingBuffer; 16 17class NetReceiver { 18public: 19 NetReceiver(BNetEndpoint *listener, 20 StreamingRingBuffer *target); 21 ~NetReceiver(); 22 23 BNetEndpoint * Endpoint() { return fEndpoint; } 24 25private: 26static 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