/* libzzsock
 *
 * This program is distributed under the GNU General Public License, version 2.
 * A copy of this license is included with this source.
 *
 * Copyright 2000-2006, Toni Thomsson <toni@tonjac.org> 
*/

#ifndef zz_sock_exception_h
#define zz_sock_exception_h

#ifdef _WIN32
    #include <winsock2.h>
#else
    #include <sys/types.h>
    #include <sys/socket.h> 
    #include <netinet/in.h>
    #include <arpa/inet.h>
    #include <netdb.h>
    #include <unistd.h>
    #include <errno.h>
    typedef int SOCKET;
    #define INVALID_SOCKET -1
    #define SOCKET_ERROR -1
#endif

#include <zz_log_exception.h>
#include <zz_export.h>

/*
    Description:
    Socket fel

    Author: 
    Toni Thomsson, toni@tonjac.org

    Library:
    libzzsock.a (HPUX) libzzsock.lib (win32)

    Platform:
    HPUX, win32
*/
class ZZ_API CzzSockException : public CzzLogException
{
public:

    /*
        Description:
        Översätter ett socket fel till ett CzzException
    */
    CzzSockException( int line,         // IN, radnummer
                        CzzString file  // IN, filnamn
                        );

    ~CzzSockException();

private:
    CzzString GetLastSocketError( void );

};

#endif // zz_sock_exception_h