//
//  Copyright © 2004, RESON Inc. All Rights Reserved.
//
//  No part of this file may be reproduced or transmitted in any form or by
//  any means, electronic or mechanical, including photocopy, recording, or
//  information storage or retrieval system, without permission in writing
//  from RESON Inc.
//
//  Filename:   
//
//  Project:    6046
//
//  Author(s):  W. Arcus
//
//  Purpose:    
//
//  Notes:      
//

#include "StdAfx.h"
#include "7kSocket.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// C7kSocket class implementation.

C7kSocket::C7kSocket( void )
{
    m_hDataEvent        = NULL;
    m_unProtocolVersion = 0;
}

C7kSocket::~C7kSocket( void )
{
    m_unProtocolVersion = 0;

    if ( m_hDataEvent != NULL )
    {
        CloseHandle( m_hDataEvent );
        m_hDataEvent = NULL;
    }
}

bool C7kSocket::Configure( const unsigned short &runProtocolVersion )
{
    m_unProtocolVersion = runProtocolVersion;

    if ( m_hDataEvent == NULL )
    {
        m_hDataEvent = CreateEvent( NULL, TRUE, FALSE, NULL );

        if ( m_hDataEvent == NULL )
        {
            TRACE( _T( "C7kSocket::StartServer(), CreateEvent() failed, code: %lu.\n" ), GetLastError() );
            return false;
        }
    }

    return true;
}

bool C7kSocket::StartServer( void )
{
    return true;
}

bool C7kSocket::StopServer( void )
{
    return true;
}

bool C7kSocket::Send( void )
{
    return true;
}

bool C7kSocket::Receive( void )
{
    return true;
}

C7kSocket::operator HANDLE( void )
{
    return m_hDataEvent;
}

unsigned short C7kSocket::ProtocolVersion( void ) const
{
    return m_unProtocolVersion;
}

