equal
deleted
inserted
replaced
212 return SDLNet_TCP_Send(csd, [string UTF8String], length); |
212 return SDLNet_TCP_Send(csd, [string UTF8String], length); |
213 } |
213 } |
214 |
214 |
215 // this is launched as thread and handles all IPC with engine |
215 // this is launched as thread and handles all IPC with engine |
216 -(void) engineProtocol:(id) object { |
216 -(void) engineProtocol:(id) object { |
217 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; |
217 @autoreleasepool { |
|
218 |
218 NSDictionary *gameConfig = (NSDictionary *)object; |
219 NSDictionary *gameConfig = (NSDictionary *)object; |
219 NSMutableArray *statsArray = nil; |
220 NSMutableArray *statsArray = nil; |
220 TCPsocket sd; |
221 TCPsocket sd; |
221 IPaddress ip; |
222 IPaddress ip; |
222 int eProto; |
223 int eProto; |
401 |
402 |
402 // Close the client socket |
403 // Close the client socket |
403 [HWUtils freePort:self.enginePort]; |
404 [HWUtils freePort:self.enginePort]; |
404 SDLNet_TCP_Close(csd); |
405 SDLNet_TCP_Close(csd); |
405 SDLNet_Quit(); |
406 SDLNet_Quit(); |
406 |
407 |
407 [pool release]; |
408 } |
|
409 |
408 // Invoking this method should be avoided as it does not give your thread a chance |
410 // Invoking this method should be avoided as it does not give your thread a chance |
409 // to clean up any resources it allocated during its execution. |
411 // to clean up any resources it allocated during its execution. |
410 //[NSThread exit]; |
412 //[NSThread exit]; |
411 } |
413 } |
412 |
414 |