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

searchForServices(ofType:inDomain:)

Starts a search for services of a particular type within a specific domain. 指定されたドメイン内の特定の型のサービスに対する検索を開始します。

Declaration 宣言

func searchForServices(ofType type: String, 
              inDomain domainString: String)

Parameters パラメータ

serviceType

Type of the service to search for. それに対して検索することになるサービスの型。

domainName

Domain name in which to perform the search. それにおいて検索を行うことになるドメイン名。

Discussion 議論

This method returns immediately, sending a netServiceBrowserWillSearch(_:) message to the delegate if the network was ready to initiate the search.The delegate receives subsequent netServiceBrowser(_:didFind:moreComing:) messages for each service discovered. このメソッドは直ぐに復帰します、netServiceBrowserWillSearch(_:)メッセージを委任先に送っています、もしネットワークが検索に着手する準備ができたならば。委任先は続いてnetServiceBrowser(_:didFind:moreComing:)メッセージを発見された各サービスに対して受け取ります。

The serviceType argument must contain both the service type and transport layer information. To ensure that the mDNS responder searches for services, rather than hosts, make sure to prefix both the service name and transport layer name with an underscore character (“_”). For example, to search for an HTTP service on TCP, you would use the type string “_http._tcp.“. Note that the period character at the end is required. serviceType引数は、サービス型とトランスポート層情報の両方を含まなければなりません。mDNSレスポンダがサービスを、ホストでなく、検索するのを確実にするには、サービス名とトランスポート層名の両方にアンダースコア文字(“_”)で接頭辞をつけるようにしてください。例えば、あるHTTPサービスをTCP上で検索するには、あなたは型文字列 “_http._tcp.“ を使うでしょう。ピリオド文字が終わりで必要とされることに注意してください。

The domainName argument can be an explicit domain name, the generic local domain @"local." (note trailing period, which indicates an absolute name), or the empty string (@""), which indicates the default registration domains. Usually, you pass in an empty string. Note that it is acceptable to use an empty string for the domainName argument when publishing or browsing a service, but do not rely on this for resolution. domainName引数は明示的なドメイン名、総称体ローカルドメイン@"local."(後に続くピリオドに注意してください、それは完全名を示します)、または省略時の登録ドメインを指し示す空文字列(@"")であることができます。大抵は、あなたは空文字列を渡します。空の文字列をdomainName引数に対して使うことは、サービスを出版またはブラウズする、しかし解決のためにこれを当てにしない場合に、受け入れられることに注意してください。

See Also 参照

Using Network Service Browsers ネットワークサービスブラウザを使う

Related Documentation 関連文書