//
//  GWebSocket.h
//  Pods
//
//  Created by gan on 2025/3/24.
//

#ifndef GWebSocket_h
#define GWebSocket_h


#endif /* GWebSocket_h */
#import "config.h"
#import "SocketRocket/SRWebSocket.h"

@protocol GWebSocketDelegate <NSObject>

- (void)onSocketConnectionStateChanged:(SRReadyState)state;

@end

static NSString * _Nullable Friendchat=@"0";
static NSString * _Nullable Groupchat=@"1";

@interface GWebSocket : NSObject
@property (nonatomic,weak) id <GWebSocketDelegate> delegate;
@property (nonatomic, assign, readonly) BOOL isReachable;

+ (GWebSocket *_Nonnull)shareInstance;
- (void)connectWebSocket;
- (void)closeWebSocket;

- (void)sendMsg:(NSString *_Nonnull)msg;
-(void)sendRecNote:(NSDictionary *_Nullable)msg;

@end
