// Interface to wsock


// Implementation is in WSock.cpp

#ifndef WSOCK_DECL


#define WSOCK_DECL true


#ifndef GLOBAL_DECL

#include "global.h"     // Global data types and variables

#endif


class wsock
{
private:
    
    SOCKET              my_socket;          // Socket variable

    SOCKADDR_IN         serv_addr;          // Server address

    char                crlf[5];            // Carriage return line feed

    int                 timeout_val;        // Timeout delay (secs)

    int                 retry_val;          // Number of retries

    bool                use_proxy;
    char                proxy_addr[100];
    int                 proxy_port;
    config*             settings;           // Pointer to program settings object

    
    void initialise();
    bool create_socket( void );
    bool check_valid( char* address );
    bool make_connection( void );
    bool send_command( char* command );
    bool get_reply( char* fname );

public:
  
    char error[100];    // Error description


    wsock(config*);     // Constructor - initialise winsock

    ~wsock();           // Destructor - shut down winsock

    
    bool get_page( char* address, char* fname );
};

#endif

syntax highlighted by Code2HTML, v. 0.8.11