1 // ------------------------------------------------
6 // see .cpp for details
8 // (c) 2002 peercast.org
9 // ------------------------------------------------
10 // This program is free software; you can redistribute it and/or modify
11 // it under the terms of the GNU General Public License as published by
12 // the Free Software Foundation; either version 2 of the License, or
13 // (at your option) any later version.
15 // This program is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 // ------------------------------------------------
26 //#include "winsock2.h"
29 // --------------------------------------------------
30 class WSAClientSocket : public ClientSocket
47 virtual void open(Host &);
48 virtual int read(void *, int);
49 virtual int readUpto(void *, int);
50 virtual void write(const void *, int);
51 virtual void bind(Host &);
52 virtual void connect();
54 virtual ClientSocket * accept();
55 virtual bool active() {return sockNum != 0;}
56 virtual bool readReady();
57 virtual Host getLocalHost();
58 virtual void setBlocking(bool);
62 void setBufSize(int size);
64 // static HOSTENT *resolveHost(const char *);
65 static hostent *resolveHost(const char *);
67 void checkTimeout(bool,bool);
68 void checkTimeout2(bool,bool);
70 virtual void bufferingWrite(const void*, int);
71 void checkBuffering(bool, bool);
73 unsigned int writeCnt;
75 struct sockaddr_in remoteAddr;
78 char apReadBuf[RBSIZE];