DWDrmServer.h 997 Bytes
Newer Older
Han Ruisong's avatar
Han Ruisong committed
1
2
3
4
5
6
7
8
9
10
11
12
13
#import <Foundation/Foundation.h>
#import <sys/socket.h>
#import <netinet/in.h>
#import <arpa/inet.h>
#import <unistd.h>

@interface DWDrmServer : NSObject

/**
 *  @brief 若 server 启动成功,listenPort 为server绑定的端口。
 */
@property (assign, nonatomic, readonly)UInt16 listenPort;

Hanruisong's avatar
Hanruisong committed
14
15
16
17
18
/**
 *  @brief 是否使用ijkPlayer,默认NO
 */
@property(nonatomic,assign)BOOL isIJKPlayer;

Hanruisong's avatar
Hanruisong committed
19
20
21
22
23
24
/*!
 * @method
 * @abstract 初始化DWDrmServer
 * @discussion 初始化DWDrmServer
 * @param port 指定drmServer监听的端口
 * @result 返回一个DWDrmServer实例
Han Ruisong's avatar
Han Ruisong committed
25
 */
Hanruisong's avatar
Hanruisong committed
26
-(id)initWithListenPort:(UInt16)port;
Han Ruisong's avatar
Han Ruisong committed
27

Hanruisong's avatar
Hanruisong committed
28
29
30
31
32
/*!
 * @method
 * @abstract 启动server
 * @discussion 启动server
 * @result 启动成功返回YES,否则返回NO
Han Ruisong's avatar
Han Ruisong committed
33
 */
Hanruisong's avatar
Hanruisong committed
34
-(BOOL)start;
Han Ruisong's avatar
Han Ruisong committed
35

Hanruisong's avatar
Hanruisong committed
36
37
38
39
/*!
 * @method
 * @abstract 停止server
 * @discussion 停止server
Han Ruisong's avatar
Han Ruisong committed
40
 */
Hanruisong's avatar
Hanruisong committed
41
-(void)stop;
Han Ruisong's avatar
Han Ruisong committed
42

Hanruisong's avatar
Hanruisong committed
43
44
45
46
47
/*!
 * @method
 * @abstract 重启server
 * @discussion 建议在app回到前台时调用,不需要调用stop/start方法了
 */
Han Ruisong's avatar
Han Ruisong committed
48
49
50
-(void)reStartSocket;

@end