#ifndef NETCLIENT_INCLUDED
	#define NETCLIENT_INCLUDED

#include <winsock.h>

class netclient
{
public:
	netclient(HINSTANCE hInst=NULL);
	~netclient();

	int open(LPCSTR szServer,int iPort=23);
	void close(void);

	long txdata(PBYTE bData,long lLen);
	long txdata(LPCSTR szData);
	long rxdata(PBYTE bData,long lLen);

	BOOL notify(void(*)(netclient*), long lNot);
	void (*func)(netclient*);

	SOCKET getsocket() {return sock;}
	SOCKADDR_IN getserver() {return server;}
	LPCTSTR getservername() {return szServerName;}

	int getport();

	long thisnotify;
	long thiserror;

private:
    LPHOSTENT host_info;
    LPSERVENT serv_info;
	HWND hWnd;
	SOCKET sock;
	SOCKADDR_IN	server;
	long notifyflags;
	LPTSTR szServerName;
};

#endif // NETCLIENT_INCLUDED