//
//  SFSIOHandler.h
//  SFS2X
//
//  Original development by Infosfer Game Technologies Ltd. | http://www.infosfer.com.
//
//  Maintained and developed by A51 Integrated.
//  Copyright 2012 A51 Integrated | http://a51integrated.com. All rights reserved.
//

#import "Common.h"
#import "IoHandler.h"
#import "DefaultPacketEncrypter.h"

EXTERN NSInteger const SFSIOHandler_SHORT_BYTE_SIZE;
EXTERN NSInteger const SFSIOHandler_INT_BYTE_SIZE;

@class PendingPacket;
@class BitSwarmClient;
@class Logger;

@interface SFSIOHandler : NSObject <IoHandler>{
@private
	__weak BitSwarmClient *_bitSwarm;
	Logger *_log;
	NSInteger _readState;
	PendingPacket *_pendingPacket;
	id <IProtocolCodec> _protocolCodec;

	NSData *_emptyBuffer;
    
    DefaultPacketEncrypter* _packetEncrypter;
}

-(id)initWithBitSwarmClient:(BitSwarmClient *)bitSwarm;

@property (nonatomic, weak) BitSwarmClient *bitSwarm;
@property (nonatomic, strong) Logger *log;
@property (nonatomic, readwrite) NSInteger readState;
@property (nonatomic, strong) id <IProtocolCodec> codec;
@property (nonatomic, strong) PendingPacket *pendingPacket;

@end
