registerPort:name:
ポート名でポートを登録します
-(BOOL)registerPort:(NSPort *)port: name:(NSString *)portName:
解説
ポート名でポートを登録します。
返り値
( BOOL )
YES/NO
引数
( NSPort * )port
( NSString * )portName
フレームワーク
Foundation
クラス
NSSocketPortNameServer
Instance Methods
使用可能
10.0
参照
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { id server; NSSocketPort *port = [[NSSocketPort alloc] initRemoteWithTCPPort:80 host:@"www.oomori.com" ]; NSConnection *connection = [NSConnection connectionWithReceivePort:nil sendPort:port]; NSSocketPortNameServer *spns = [NSSocketPortNameServer sharedInstance]; ([spns registerPort:port name:@"www.oomori.com" ]) ? NSLog(@"YES") : NSLog(@"NO"); NSLog ([NSString stringWithFormat:@"%d",[port protocol]]); NSLog ([spns description]); } @end