mirror of
https://github.com/dsward2/macSVG.git
synced 2026-03-02 18:23:58 +01:00
35 lines
589 B
Objective-C
Executable File
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
|