-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathServer.h
57 lines (45 loc) · 1.19 KB
/
Server.h
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
//
// Server.h
// ServerStatus
//
// Created by Florian Mutter on 14.05.10.
// Copyright 2010 skweez.net. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "SimplePing.h"
#define MaxPingTimeoutCount 3
#define PingTimoutInSeconds 10
typedef enum {
SERVER_UNKNOWN,
SERVER_OK,
SERVER_FAIL,
SERVER_ERROR
} ServerStatus;
@interface Server : NSObject <SimplePingDelegate, NSCoding> {
NSString *serverName;
NSString *serverHost;
NSError *serverError;
NSData *lastKnownAddress;
NSInteger pingTimeoutCount;
ServerStatus serverStatus;
ServerStatus previousStatus;
BOOL active;
BOOL pinging;
SimplePing *_pinger;
NSTimer *pingTimeout;
}
@property (nonatomic, retain) NSString *serverName;
@property (nonatomic, retain) NSString *serverHost;
@property (retain) NSError *serverError;
@property (retain) NSData *lastKnownAddress;
@property (assign) BOOL active;
@property (assign) BOOL pinging;
@property NSInteger pingTimeoutCount;
@property (nonatomic) ServerStatus serverStatus;
@property ServerStatus previousStatus;
@property (retain) SimplePing *pinger;
@property (retain) NSTimer *pingTimeout;
+ (Server *)server;
- (NSString *)lastKnownAddressAsString;
- (void)ping;
@end