2016-11-09 6 views
1

私のセットアップ私は何もしないところ、私は非常にシンプルなiOSのXamarinのプロジェクトを持っているhttps://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/UnderstandingandPreparingfortheIPv6Transition/UnderstandingandPreparingfortheIPv6Transition.html#//apple_ref/doc/uid/TP40010220-CH213-SW1Xamarin iOSのWebRequestがipv6環境で動作しないのはなぜですか?

次のローカルIPv6環境:

WebRequest req = WebRequest.Create("http://109.68.230.138"); 
WebResponse response = req.GetResponse(); //exception 
var dataStream = response.GetResponseStream(); 
StreamReader reader = new StreamReader(dataStream); 
string responseFromServer = reader.ReadToEnd(); 

ライン2で、私は次の例外を取得します。これがどう動くべきか、あるいはこれをどうやって動かすべきかを誰かが知っているなら、素晴らしいでしょう。私はipv4アドレスを渡すことはまだcommomユースケースだと思います。

Unhandled Exception: 
System.Net.WebException: Error: ConnectFailure (Network is unreachable) ---> System.Net.Sockets.SocketException: Network is unreachable 
    at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x000cb] in /Users/builder/data/lanes/3859/b638977c/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net.Sockets/Socket.cs:1313 
    at System.Net.WebConnection.Connect (System.Net.HttpWebRequest request) [0x001c2] in /Users/builder/data/lanes/3859/b638977c/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net/WebConnection.cs:195 
    --- End of inner exception stack trace --- 
    at System.Net.HttpWebRequest.EndGetResponse (System.IAsyncResult asyncResult) [0x00065] in /Users/builder/data/lanes/3859/b638977c/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net/HttpWebRequest.cs:1025 
    at System.Net.HttpWebRequest.GetResponse() [0x0000e] in /Users/builder/data/lanes/3859/b638977c/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net/HttpWebRequest.cs:1037 
    at Test.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication application, Foundation.NSDictionary launchOptions) [0x0000d] in /Users/xxx/Projects/Test/iOS/AppDelegate.cs:26 
    at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr) 
    at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/3859/b638977c/source/xamarin-macios/src/UIKit/UIApplication.cs:79 
    at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/3859/b638977c/source/xamarin-macios/src/UIKit/UIApplication.cs:63 
    at Test.iOS.Application.Main (System.String[] args) [0x00008] in /Users/xxx/Projects/Test/iOS/Main.cs:17 
2016-11-09 09:34:32.194 Test.iOS[763:313310] Unhandled managed exception: 
Error: ConnectFailure (Network is unreachable) (System.Net.WebException) 
    at System.Net.HttpWebRequest.EndGetResponse (System.IAsyncResult asyncResult) [0x00065] in /Users/builder/data/lanes/3859/b638977c/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net/HttpWebRequest.cs:1025 
    at System.Net.HttpWebRequest.GetResponse() [0x0000e] in /Users/builder/data/lanes/3859/b638977c/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net/HttpWebRequest.cs:1037 
    at Test.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication application, Foundation.NSDictionary launchOptions) [0x0000d] in /Users/xxx/Projects/Test/iOS/AppDelegate.cs:26 
    at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr) 
    at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/3859/b638977c/source/xamarin-macios/src/UIKit/UIApplication.cs:79 
    at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/3859/b638977c/source/xamarin-macios/src/UIKit/UIApplication.cs:63 
    at Test.iOS.Application.Main (System.String[] args) [0x00008] in /Users/xxx/Projects/Test/iOS/Main.cs:17 
--- inner exception --- 
Network is unreachable (System.Net.Sockets.SocketException) 
    at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x000cb] in /Users/builder/data/lanes/3859/b638977c/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net.Sockets/Socket.cs:1313 
    at System.Net.WebConnection.Connect (System.Net.HttpWebRequest request) [0x001c2] in /Users/builder/data/lanes/3859/b638977c/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net/WebConnection.cs:195 
2016-11-09 09:34:32.195 Test.iOS[763:313310] critical: Stacktrace: 

2016-11-09 09:34:32.195 Test.iOS[763:313310] critical: 
Native stacktrace: 

2016-11-09 09:34:32.265 Test.iOS[763:313310] critical: 0 libmonosgen-2.0.dylib    0x00000001001abd0c mono_handle_native_sigsegv + 260 
2016-11-09 09:34:32.266 Test.iOS[763:313310] critical: 1 libsystem_platform.dylib   0x0000000192eec348 _sigtramp + 52 
2016-11-09 09:34:32.266 Test.iOS[763:313310] critical: 2 libsystem_pthread.dylib    0x0000000192ef2450 pthread_kill + 112 
2016-11-09 09:34:32.266 Test.iOS[763:313310] critical: 3 libsystem_c.dylib     0x0000000192d9e3e0 abort + 140 
2016-11-09 09:34:32.267 Test.iOS[763:313310] critical: 4 libxamarin-debug.dylib    0x0000000100480d90 _ZL20print_all_exceptionsP10MonoObject + 0 
2016-11-09 09:34:32.267 Test.iOS[763:313310] critical: 5 libmonosgen-2.0.dylib    0x00000001001ac59c mono_invoke_unhandled_exception_hook + 100 
2016-11-09 09:34:32.267 Test.iOS[763:313310] critical: 6 libmonosgen-2.0.dylib    0x00000001001ab830 mono_handle_exception_internal + 3860 
2016-11-09 09:34:32.268 Test.iOS[763:313310] critical: 7 libmonosgen-2.0.dylib    0x00000001001aa910 mono_handle_exception + 40 
2016-11-09 09:34:32.268 Test.iOS[763:313310] critical: 8 libmonosgen-2.0.dylib    0x00000001001a1be4 mono_arm_throw_exception + 216 
2016-11-09 09:34:32.268 Test.iOS[763:313310] critical: 9 libmscorlib.dll.dylib    0x00000001007a9918 throw_exception + 168 
2016-11-09 09:34:32.268 Test.iOS[763:313310] critical: 10 libSystem.dll.dylib     0x0000000100bbac44 System_Net_HttpWebRequest_EndGetResponse_System_IAsyncResult + 388 
2016-11-09 09:34:32.269 Test.iOS[763:313310] critical: 11 libSystem.dll.dylib     0x0000000100bbacc0 System_Net_HttpWebRequest_GetResponse + 112 
2016-11-09 09:34:32.269 Test.iOS[763:313310] critical: 12 libTest.iOS.exe.dylib    0x00000001000770b4 Test_iOS_AppDelegate_FinishedLaunching_UIKit_UIApplication_Foundation_NSDictionary + 276 
2016-11-09 09:34:32.269 Test.iOS[763:313310] critical: 13 libmscorlib.dll.dylib    0x0000000100786db4 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 244 
2016-11-09 09:34:32.269 Test.iOS[763:313310] critical: 14 libmonosgen-2.0.dylib    0x00000001001ba1dc mono_jit_runtime_invoke + 1772 
2016-11-09 09:34:32.270 Test.iOS[763:313310] critical: 15 libmonosgen-2.0.dylib    0x000000010022ad0c do_runtime_invoke + 112 
2016-11-09 09:34:32.270 Test.iOS[763:313310] critical: 16 libmonosgen-2.0.dylib    0x000000010022ac68 mono_runtime_invoke + 208 
2016-11-09 09:34:32.270 Test.iOS[763:313310] critical: 17 Test.iOS       0x000000010005c62c _ZL30native_to_managed_trampoline_5P11objc_objectP13objc_selectorPP11_MonoMethodP13UIApplicationP12NSDictionaryPKcSB_SB_SB_ + 692 
2016-11-09 09:34:32.270 Test.iOS[763:313310] critical: 18 Test.iOS       0x000000010005c368 -[AppDelegate application:didFinishLaunchingWithOptions:] + 96 
2016-11-09 09:34:32.271 Test.iOS[763:313310] critical: 19 UIKit        0x0000000199d20100 <redacted> + 400 
2016-11-09 09:34:32.271 Test.iOS[763:313310] critical: 20 UIKit        0x0000000199f30858 <redacted> + 3524 
2016-11-09 09:34:32.271 Test.iOS[763:313310] critical: 21 UIKit        0x0000000199f365c8 <redacted> + 1656 
2016-11-09 09:34:32.271 Test.iOS[763:313310] critical: 22 UIKit        0x0000000199f4ae60 <redacted> + 48 
2016-11-09 09:34:32.272 Test.iOS[763:313310] critical: 23 UIKit        0x0000000199f335ac <redacted> + 168 
2016-11-09 09:34:32.272 Test.iOS[763:313310] critical: 24 FrontBoardServices     0x0000000195a018bc <redacted> + 36 
2016-11-09 09:34:32.272 Test.iOS[763:313310] critical: 25 FrontBoardServices     0x0000000195a01728 <redacted> + 176 
2016-11-09 09:34:32.272 Test.iOS[763:313310] critical: 26 FrontBoardServices     0x0000000195a01ad0 <redacted> + 56 
2016-11-09 09:34:32.273 Test.iOS[763:313310] critical: 27 CoreFoundation      0x0000000193e08278 <redacted> + 24 
2016-11-09 09:34:32.273 Test.iOS[763:313310] critical: 28 CoreFoundation      0x0000000193e07bc0 <redacted> + 524 
2016-11-09 09:34:32.273 Test.iOS[763:313310] critical: 29 CoreFoundation      0x0000000193e057c0 <redacted> + 804 
2016-11-09 09:34:32.273 Test.iOS[763:313310] critical: 30 CoreFoundation      0x0000000193d34048 CFRunLoopRunSpecific + 444 
2016-11-09 09:34:32.274 Test.iOS[763:313310] critical: 31 UIKit        0x0000000199d192b0 <redacted> + 608 
2016-11-09 09:34:32.274 Test.iOS[763:313310] critical: 32 UIKit        0x0000000199d14034 UIApplicationMain + 208 
2016-11-09 09:34:32.274 Test.iOS[763:313310] critical: 33 libXamarin.iOS.dll.dylib   0x0000000100514fb4 wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 324 
2016-11-09 09:34:32.274 Test.iOS[763:313310] critical: 34 libXamarin.iOS.dll.dylib   0x00000001004d61ac UIKit_UIApplication_Main_string___intptr_intptr + 44 
2016-11-09 09:34:32.275 Test.iOS[763:313310] critical: 35 libXamarin.iOS.dll.dylib   0x00000001004d616c UIKit_UIApplication_Main_string___string_string + 172 
2016-11-09 09:34:32.275 Test.iOS[763:313310] critical: 36 libTest.iOS.exe.dylib    0x0000000100076de0 Test_iOS_Application_Main_string__ + 160 
2016-11-09 09:34:32.275 Test.iOS[763:313310] critical: 37 libmscorlib.dll.dylib    0x0000000100786db4 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 244 
2016-11-09 09:34:32.275 Test.iOS[763:313310] critical: 38 libmonosgen-2.0.dylib    0x00000001001ba1dc mono_jit_runtime_invoke + 1772 
2016-11-09 09:34:32.276 Test.iOS[763:313310] critical: 39 libmonosgen-2.0.dylib    0x000000010022ad0c do_runtime_invoke + 112 
2016-11-09 09:34:32.276 Test.iOS[763:313310] critical: 40 libmonosgen-2.0.dylib    0x000000010022d2f0 mono_runtime_exec_main + 832 
2016-11-09 09:34:32.276 Test.iOS[763:313310] critical: 41 libmonosgen-2.0.dylib    0x000000010022cf0c mono_runtime_run_main + 764 
2016-11-09 09:34:32.276 Test.iOS[763:313310] critical: 42 libmonosgen-2.0.dylib    0x000000010019e7f8 mono_jit_exec + 236 
2016-11-09 09:34:32.277 Test.iOS[763:313310] critical: 43 libxamarin-debug.dylib    0x000000010048dcd8 xamarin_main + 2168 
2016-11-09 09:34:32.277 Test.iOS[763:313310] critical: 44 Test.iOS       0x000000010005de50 main + 96 
2016-11-09 09:34:32.277 Test.iOS[763:313310] critical: 45 libdyld.dylib      0x0000000192d185b8 <redacted> + 4 
2016-11-09 09:34:32.277 Test.iOS[763:313310] critical: 
================================================================= 
Got a SIGABRT while executing native code. This usually indicates 
a fatal error in the mono runtime or one of the native libraries 
used by your application. 
================================================================= 

答えて

2

IPv4アドレスリテラルは使用できません。それは、IPv6のみの環境では機能しないため、自動失敗やアプリの拒否です。代わりにホスト名を使用する必要があります。

+0

ネイティブ開発の同じアプリが動作し、拒否されませんでした。 NSUrlSessionのような高レベルのフレームワークを使用する限り、それはうまくいくはずです。私にはXamarinのバグのように見えます。 (HttpClientはNSURLSessionを注入することができるため動作しますが、WebRequestはそうではありません)直接ip4呼び出しがアプリ拒否につながることが確かであれば、 – shorty

0

アップルは純粋なipv6環境でテストされているようですので、ダイレクトコールは失敗します。これは、彼らが昨日私のアプリを失敗したときに彼らのコメントです:問題(複数可)を識別するために、IPv6ネットワーク に接続された(すべてのアプリケーションがIPv6をサポートしている必要があります)しながら、

デバイス上でアプリケーションを実行してください、その後、修正および レビューのためにアプリを再送信してください。

アプリの意図した動作が誤解された場合は、 の機能がどのように機能するのかについての情報を提供するために、解決センターでこのメッセージに に返信してください。

新しいアプリの場合は、 端末からアプリの以前のバージョンをすべてアンインストールしてから、インストールして手順に従って問題を再現してください。 更新プログラムの場合は、新しいバージョンを以前の バージョンの更新プログラムとしてインストールし、手順に従って問題を再現してください。

リソースのIPv6ネットワークのサポートの詳細については

は、 Supporting IPv6 DNS64/NAT64 Networks and About Networkingを参照してください。

+0

マイケルハンプトンの答えに上記のコメントを参照してください – shorty

関連する問題