#include "stdafx.h"
#include "P4BridgeClient.h"
#include "P4Connection.h"
#ifdef _DEBUG_MEMORY
P4Connection::P4Connection(ConnectionManager* conMgr, P4BridgeServer* pServer, int cmdId)
	: DoublyLinkedListItem((DoublyLinkedList *)conMgr, cmdId), p4base(tP4Connection)
#else
P4Connection::P4Connection(ConnectionManager* conMgr, P4BridgeServer* pServer, int cmdId)
	: DoublyLinkedListItem((DoublyLinkedList *)conMgr, cmdId)
#endif
{
		clientNeedsInit = 1;
		ui = NULL;
		isAlive = 1;
}
P4Connection::~P4Connection(void)
{
	if (clientNeedsInit == 0)
	{
		Error e;
		this->Final( &e );
		clientNeedsInit = 1;
	}
	if (ui)
	{
		delete ui;
	}
}
void P4Connection::cancel_command() 
{
	isAlive = 0;
}
// KeepAlive functionality
int	P4Connection::IsAlive()
{
	return isAlive;
}
void P4Connection::Disconnect( void )
{
	if (clientNeedsInit == 0)
	{
		Error e;
		this->Final( &e );
		clientNeedsInit = 1;
	}
}
void P4Connection::SetCharset( CharSetApi::CharSet c, CharSetApi::CharSet filec )
{	
	ClientApi::SetCharset(CharSetApi::Name(filec));
	SetTrans( CharSetApi::NOCONV, filec, c, CharSetApi::NOCONV );
}
                     
                                
                    
                
            
                | # | 
                Change | 
                User | 
                Description | 
                Committed | 
                 | 
            
        
        
        
        
            
                | 
                    
                        #3                    
                 | 
                
                    28480                 | 
                
                    eskopljak                 | 
                
                    submit                 | 
                
                    
                 | 
                
                                            
                                                                
                                                                
                                                         | 
            
        
            
                | 
                    
                        #2                    
                 | 
                
                    28479                 | 
                
                    eskopljak                 | 
                
                    submit                 | 
                
                    
                 | 
                
                                                                                                        
                                     | 
            
        
            
                | 
                    
                        #1                    
                 | 
                
                    28441                 | 
                
                    eskopljak                 | 
                
                    Merging using p4api.net_branch                 | 
                
                    
                 | 
                
                                            
                                                                
                                                                
                                                         | 
            
                
    
                
            
                | 
                    
                    //guest/perforce_software/p4api-net/main/p4bridge/P4Connection.cpp                 | 
            
        
        
        
        
            
                | 
                    
                        #1                    
                 | 
                
                    19043                 | 
                
                    Liz Lam                 | 
                
                    Rename p4api.net to p4api-net                 | 
                
                    
                 | 
                
                                            
                                                                
                                                                
                                                         | 
            
                
    
                
            
                | 
                    
                    //guest/perforce_software/p4api.net/main/p4bridge/P4Connection.cpp                 | 
            
        
        
        
        
            
                | 
                    
                        #1                    
                 | 
                
                    19042                 | 
                
                    Liz Lam                 | 
                
                    Rename/move file(s) to proper main branch.                 | 
                
                    
                 | 
                
                                            
                                                                
                                                                
                                                         | 
            
                
    
                
            
                | 
                    
                    //guest/perforce_software/p4api.net/p4bridge/P4Connection.cpp                 | 
            
        
        
        
        
            
                | 
                    
                        #3                    
                 | 
                
                    11220                 | 
                
                    Matt Attaway                 | 
                
                    Update Workshop version with most recent 14.2 patch of p4api.net                 | 
                
                    
                 | 
                
                                            
                                                                
                                                                
                                                         | 
            
        
            
                | 
                    
                        #2                    
                 | 
                
                    8964                 | 
                
                    Bill                 | 
                
                    fix line endings                 | 
                
                    
                 | 
                
                                            
                                                                
                                                                
                                                         | 
            
        
            
                | 
                    
                        #1                    
                 | 
                
                    8873                 | 
                
                    Matt Attaway                 | 
                
                    Initial add of the P4API.NET source code                 | 
                
                    
                 | 
                
                                            
                                                                
                                                                
                                                         |