Created
October 29, 2012 15:34
-
-
Save sebastienwindal/3974218 to your computer and use it in GitHub Desktop.
.h file example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // WGenServer.h | |
| // WgenTestCommon | |
| // | |
| // Created by Sebastian Windal on 10/24/12. | |
| // Copyright (c) 2012 Sebastian Windal. All rights reserved. | |
| // | |
| #import <Foundation/Foundation.h> | |
| #import "WGenPeer.h" | |
| @class WGenServer; | |
| @protocol WGenServerDelegate <NSObject> | |
| @optional | |
| -(void)wgenServerDelegate:(WGenServer *)server clientDidConnect:(NSString *)peerID; | |
| -(void)wgenServerDelegate:(WGenServer *)server clientDidDisconnect:(NSString *)peerID; | |
| -(void)wgenServerDelegateSessionDidEnd:(WGenServer *)server; | |
| -(void)wgenServerDelegateNoNetwork:(WGenServer *)server; | |
| -(void)wgenServerDelegate:(WGenServer *)server didReceiveData:(NSDictionary *)data fromPeer:(NSString *)peerID; | |
| -(void)wgenServerDelegate:(WGenServer *)server peer:(NSString *)peerID updatedName:(NSString *)name; | |
| @end | |
| @interface WGenServer : WGenPeer | |
| @property (nonatomic, strong) id<WGenServerDelegate> delegate; | |
| +(WGenServer *) serverWithSession:(NSString *)sessionID; | |
| -(void) startAcceptingConnectionsForSessionID:(NSString *)sessionID; | |
| -(void) endSession; | |
| -(void) sendCommandToAllClients:(NSDictionary *)dict error:(NSError **)error; | |
| -(void) sendCommand:(NSDictionary *)dict toPeer:(NSString *)clientID; | |
| -(NSString *) displayNameForPeerID:(NSString *)peerID; | |
| -(NSString *) displayNameForPeerAtIndex:(int) index; | |
| -(int) numberPeers; | |
| @end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment