本日は MRTK の調査枠です。
MRTK2017.4.3 でサーバクライアント型の Sharing が繋がらない問題について確認したので記事にします。
本記事は2019/5/23現在、MRTK 2017 の最新バージョン 2017.4.3.0-Refresh で確認しています。
発生事象
MRTK2017.4.3 のサーバクライアント型の Sharing 機能を行ってもサーバ側プログラムの SharingService.exe にコネクションできません。
以下は Examples の HoloToolkit-Examples/Sharing/SharingService/Scene/SharingTest.unity のサンプルでの実行結果です。
![f:id:bluebirdofoz:20190523090258j:plain f:id:bluebirdofoz:20190523090258j:plain](https://cdn-ak.f.st-hatena.com/images/fotolife/b/bluebirdofoz/20190523/20190523090258.jpg)
IPアドレスを指定して[Connect]を行っても黄色アイコンが点灯したままでサーバプログラムにコネクションできません。
サーバ側のコマンドラインでもセッションが追加されず、全く反応がありません。
![f:id:bluebirdofoz:20190523090327j:plain f:id:bluebirdofoz:20190523090327j:plain](https://cdn-ak.f.st-hatena.com/images/fotolife/b/bluebirdofoz/20190523/20190523090327.jpg)
原因
スクリプトバックエンドに[IL2CPP]を指定していた事が原因でした。
![f:id:bluebirdofoz:20190523090403j:plain f:id:bluebirdofoz:20190523090403j:plain](https://cdn-ak.f.st-hatena.com/images/fotolife/b/bluebirdofoz/20190523/20190523090403.jpg)
MRTK2017.4.3 のサーバクライアント型シェアリングは IL2CPP に対応していません。
github.com
対応法
サーバクライアント型の Sharing 機能を利用する場合はスクリプトバックエンドに[.Net]を指定します。
![f:id:bluebirdofoz:20190523090455j:plain f:id:bluebirdofoz:20190523090455j:plain](https://cdn-ak.f.st-hatena.com/images/fotolife/b/bluebirdofoz/20190523/20190523090455.jpg)
[.Net]を指定して SharingTest.unity のサンプルを利用した実行結果です。
![f:id:bluebirdofoz:20190523090504j:plain f:id:bluebirdofoz:20190523090504j:plain](https://cdn-ak.f.st-hatena.com/images/fotolife/b/bluebirdofoz/20190523/20190523090504.jpg)
コネクションが正常に行われ、緑アイコンが転倒しました。
サーバ側のコマンドラインでもセッションが追加された事が確認できます。
![f:id:bluebirdofoz:20190523090518j:plain f:id:bluebirdofoz:20190523090518j:plain](https://cdn-ak.f.st-hatena.com/images/fotolife/b/bluebirdofoz/20190523/20190523090518.jpg)