-
-
Notifications
You must be signed in to change notification settings - Fork 132
/
TPEventsReceiver.m
47 lines (40 loc) · 811 Bytes
/
TPEventsReceiver.m
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
//
// TPEventsReceiver.m
// Teleport
//
// Created by JuL on Thu Dec 04 2003.
// Copyright (c) 2003 abyssoft. All rights reserved.
//
#import "TPEventsReceiver.h"
#import "TPUDPSocket.h"
#import "TPEventsPlayer.h"
#import "common.h"
@implementation TPEventsReceiver
- init
{
self = [super init];
//udpSocket = nil;
return self;
}
- (BOOL)listenOnPort:(int)port
{
udpSocket = [TPUDPSocket UDPSocketListeningOnPort:port];
if(!udpSocket)
return FALSE;
[udpSocket retain];
[udpSocket setDelegate:self];
[self connect];
//NSLog(@"listening");
return TRUE;
}
- (void)stopListening
{
[super disconnect];
}
- (void)disconnect
{
//[self sendMessage:[TPMessage messageWithType:STOP_CONTROLLING]];
[self stopListening];
[super disconnect];
}
@end