Files
2016-09-15 10:13:52 -05:00

35 lines
589 B
Objective-C
Executable File

#import "MyWebSocket.h"
#import "HTTPLogging.h"
// Log levels: off, error, warn, info, verbose
// Other flags : trace
static const int httpLogLevel = HTTP_LOG_LEVEL_WARN | HTTP_LOG_FLAG_TRACE;
@implementation MyWebSocket
- (void)didOpen
{
HTTPLogTrace();
[super didOpen];
[self sendMessage:@"Welcome to my WebSocket"];
}
- (void)didReceiveMessage:(NSString *)msg
{
HTTPLogTrace2(@"%@[%p]: didReceiveMessage: %@", THIS_FILE, self, msg);
[self sendMessage:[NSString stringWithFormat:@"%@", [NSDate date]]];
}
- (void)didClose
{
HTTPLogTrace();
[super didClose];
}
@end