31 @property(strong, NS_NONATOMIC_IOSONLY) NSMutableSet *streamPairs;
37 @synthesize streamPairs;
41 [
self setStreamPairs:[NSMutableSet set]];
46 NSError *__autoreleasing error = nil;
49 STAssertNotNil(serverSocket, nil);
50 STAssertTrue([serverSocket setReuseAddressOption:YES], nil);
52 STAssertNil(error, nil);
53 STAssertEquals([serverSocket addressFamily], AF_INET6, nil);
54 STAssertEquals([serverSocket port], 54321, nil);
60 [serverSocket setDelegate:self];
64 [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:10.0]];
74 [streamPair setDelegate:self];
78 - (void)streamPair:(
CFStreamPair *)streamPair hasBytesAvailable:(NSUInteger)bytesAvailable
83 [streamPair
sendBytes:[[NSString stringWithFormat:@"MCP: %@", line] dataUsingEncoding:NSUTF8StringEncoding]];
87 - (void)streamPair:(
CFStreamPair *)streamPair handleRequestEvent:(NSStreamEvent)eventCode
91 case NSStreamEventEndEncountered: