Instance Method インスタンスメソッド

registerName:withNameServer:

Registers a service with the specified port name server. あるサービスをこの指定されたポート名サーバに登録します。

Declaration 宣言

- (BOOL)registerName:(NSString *)name 
      withNameServer:(NSPortNameServer *)server;

Parameters パラメータ

name

The name under which to register the receiver. それのもとこのレシーバを登録することになる名前。

server

The name server. ネームサーバー。

Return Value 戻り値

YES if the operation was successful, otherwise NO (for example, if another NSConnection object on the same host is already registered under name). YES、もし演算が成功であるならば、そうでなければNO(例えば、別のNSConnectionオブジェクトが同じホスト上で既にnameのもと登録されるならば)。

Discussion 議論

This method connects the receive port of the receiving NSConnection object with the specified service name. If the operation is successful, other NSConnection objects can contact the receiver using the connectionWithRegisteredName:host: and rootProxyForConnectionWithRegisteredName:host: class methods. このメソッドは、受け取っているNSConnectionオブジェクトの受信ポートにこの指定されたサービス名で接続します。演算が成功するならば、他のNSConnectionオブジェクトはレシーバにconnectionWithRegisteredName:host:rootProxyForConnectionWithRegisteredName:host:クラスメソッドを使って連絡します。

If the receiver was already registered under a name and this method returns NO, the old name remains in effect. If this method is successful, it also unregisters the old name. レシーバが既にある名前のもと登録されたそしてこのメソッドがNOを返すならば、古い名前は有効なままです。このメソッドが成功するならば、それはまた古い名前を登録解除します。

To unregister an NSConnection object, simply invoke registerName: and supply nil as the connection name. NSConnectionオブジェクトを登録解除するには、単純にregisterName:を発動してnilを接続名として提供してください。

See Also 参照

Vending a Service サービスの販売