2 * MP3/MPlayer plugin to VDR (C++)
4 * (C) 2001-2005 Stefan Huelswitt <s.huelswitt@gmx.de>
6 * This code is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This code is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
25 #include <vdr/thread.h>
26 #include <vdr/ringbuffer.h>
28 class cRingBufferLinear;
30 // ----------------------------------------------------------------
32 class cNet : public cRingBufferLinear, cThread {
35 bool connected, netup;
37 int rwTimeout, conTimeout;
38 unsigned char lineBuff[4096];
42 int RingRead(unsigned char *dest, int len);
43 void CopyFromBuff(unsigned char *dest, int n);
45 virtual void Action(void);
47 cNet(int size, int ConTimeoutMs, int RwTimeoutMs);
49 bool Connect(const char *hostname, const int port);
50 void Disconnect(void);
51 bool Connected(void) { return connected; }
52 int Gets(char *dest, int len);
54 int Read(unsigned char *dest, int len);
55 int Write(unsigned char *dest, int len);