Skip to content
This repository was archived by the owner on Oct 20, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 28 additions & 19 deletions PSAutobahnServerTests/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,45 +11,54 @@

@interface AppDelegate () <PSWebSocketServerDelegate>

@property (nonatomic, strong) PSWebSocketServer *server;
@property(nonatomic, strong) PSWebSocketServer *server;

@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
// Create a local server at a random available port
self.server = [PSWebSocketServer localServer];
self.server.delegate = self;
[self.server start];

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.

self.server = [PSWebSocketServer serverWithHost:@"127.0.0.1" port:9001];
self.server.delegate = self;
[self.server start];

return YES;
return YES;
}

#pragma mark - PSWebSocketServerDelegate

- (void)serverDidStart:(PSWebSocketServer *)server {
NSLog(@"WebSockets Server started at port %zd", server.port);
}
- (void)server:(PSWebSocketServer *)server didFailWithError:(NSError *)error {
[NSException raise:NSInternalInconsistencyException format:error.localizedDescription];
[NSException raise:NSInternalInconsistencyException
format:@"didFailWithError: %@", error.localizedDescription];
}
- (void)serverDidStop:(PSWebSocketServer *)server {
[NSException raise:NSInternalInconsistencyException format:@"Server stopped unexpected."];
[NSException raise:NSInternalInconsistencyException
format:@"Server stopped unexpected."];
}

- (void)server:(PSWebSocketServer *)server webSocketDidOpen:(PSWebSocket *)webSocket {

- (void)server:(PSWebSocketServer *)server
webSocketDidOpen:(PSWebSocket *)webSocket {
}
- (void)server:(PSWebSocketServer *)server webSocket:(PSWebSocket *)webSocket didReceiveMessage:(id)message {
[webSocket send:message];
- (void)server:(PSWebSocketServer *)server
webSocket:(PSWebSocket *)webSocket
didReceiveMessage:(id)message {
[webSocket send:message];
}
- (void)server:(PSWebSocketServer *)server webSocket:(PSWebSocket *)webSocket didFailWithError:(NSError *)error {

- (void)server:(PSWebSocketServer *)server
webSocket:(PSWebSocket *)webSocket
didFailWithError:(NSError *)error {
}
- (void)server:(PSWebSocketServer *)server webSocket:(PSWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean {

- (void)server:(PSWebSocketServer *)server
webSocket:(PSWebSocket *)webSocket
didCloseWithCode:(NSInteger)code
reason:(NSString *)reason
wasClean:(BOOL)wasClean {
}

@end
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
Expand Down
3 changes: 3 additions & 0 deletions PocketSocket.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@
TargetAttributes = {
EE453D0E1CABF60300A2EA13 = {
CreatedOnToolsVersion = 7.3;
DevelopmentTeam = Z68VHL6FZT;
};
EEE5E35F18B37F8700BAE47A = {
TestTargetID = EEE5E30918B37DD500BAE47A;
Expand Down Expand Up @@ -562,6 +563,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = Z68VHL6FZT;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
Expand All @@ -585,6 +587,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = Z68VHL6FZT;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
Expand Down
Loading