//
//  SocketServiceHandler.h
//  OneCable
//
//  Created by KaRam Kim on 2017. 2. 17..
//  Copyright © 2017년 ntels. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <SocketRocket/SRWebSocket.h>
#import "SocketMsgModel.h"

@protocol SocketServiceDelegate <NSObject>

@optional
- (void) socketConnectComplete;
- (void) socketDidReceiveMessage:(id)message result:(SocketModel *)result;
- (void) socketDidFailWithError:(NSError *)error;
- (void) socketDidReceivePong:(NSData *)pongPayload;
- (void) socketDidCloseWithCode:(NSInteger)code;

@end


@interface SocketServiceHandler : NSObject

//@property (nonatomic, weak) id<SocketServiceDelegate> delegate;
@property (readonly, nonatomic) BOOL isConnected;

@property (nonatomic, strong) NSString* strSocketURL;

+ (id)sharedManager;

- (void) open;
- (void) close;

- (void) sendDataWihOutDelegate:(SocketRequestModel *)data;
- (void) sendDataWithDelegate:(SocketRequestModel *)data delegate:(id)delegate;
- (void) sendDataWithDelegate:(SocketRequestModel *)data modelClass:(Class)modelClass delegate:(id)delegate;
- (void) sendDataWithDelegate:(SocketRequestModel *)data modelClass:(Class)modelClass delegate:(id)delegate isShowLoading:(BOOL)isShowLoading;
- (void)setDelegateController:(id)delegate;
//- (void) initDelegate:(id<SocketServiceDelegate>) delegate;

- (SRReadyState) getSocketStatus;


@end
