-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathNNNetworkSync.h
More file actions
61 lines (49 loc) · 1.4 KB
/
NNNetworkSync.h
File metadata and controls
61 lines (49 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
// NNNetworkSync.h
// lunchd
//
// Created by MacRae Linton on 3/28/10.
// Copyright 2010 Apple Inc.. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "AsyncSocket.h"
#import "NNLunchControl.h"
@class NNNMessage;
@class NNLunchControl;
@interface NNNetworkSync : NSObject {
AsyncSocket *listeningSocket;
NNLunchControl *controller;
NSNetService *myNetService;
NSNetServiceBrowser *netBrowser;
NSMutableArray *connectedSockets;
NSMutableArray *connectedHosts;
}
@property (retain) NSMutableArray *connectedSockets;
@property (retain) NSMutableArray *connectedHosts;
- (id)initWithController:(NNLunchControl *)control;
- (IBAction)startServer:(id)sender;
- (void)startSearching;
- (void)sendMessage:(NNNMessage *)message onSocket:(AsyncSocket*)socket;
- (void)onSocket:(AsyncSocket *)sock willDisconnectWithError:(NSError *)err;
- (void)broadcastMessage:(NNNMessage *)message;
- (void)netServiceDidResolveAddress:(NSNetService *)sender;
@end
@interface NNNMessage : NSObject <NSCoding> {
int tag;
int state;
NSString *name;
NSString *veto;
NSArray *votes;
NSArray *restaurantList;
NSString *choice;
NSString *group;
}
@property (assign) int tag;
@property (assign) int state;
@property (copy) NSString *name;
@property (copy) NSString *veto;
@property (retain) NSArray *votes;
@property (retain) NSArray *restaurantList;
@property (copy) NSString *group;
@property (copy) NSString *choice;
@end