//
//  WSSesseonController.h
//  WifiPrint
//
//  Created by woosimsystems on 2015. 5. 19..
//  Copyright (c) 2015년 woosimsystems. All rights reserved.
//
#import <Foundation/Foundation.h>

#define ESC     0x1b


extern NSString *WSDataReceivedNotification;
extern NSString *socketDidConnectNotification;
extern NSString *socketDidDisconnectNotification;

@interface WSSessionController : NSObject <NSStreamDelegate> {
    NSMutableData *_outData;
    NSMutableData *_inData;
}

@property (nonatomic, readonly) NSString *hostIP;
@property (nonatomic, readonly) NSInteger port;


+ (WSSessionController *)sharedController;

- (void)setupControllerForNetwork:(NSString *)IPString withPort:(NSString *)portString;

- (BOOL)openSession;
- (void)closeSession;

- (void)writeData:(NSData *)data;
- (NSData *)readData:(NSUInteger)bytesToRead;
- (NSUInteger)getAvailableReadBytes;

@end