我在使用ftp连接存储和加载.xml文件的webgl构建中遇到了问题。在编辑器和本地ftp服务器(使用Xlight)中,一切正常工作。但是,当我构建webgl解决方案并试图保存一个.xml文件时,我会得到以下错误:
> Uncaught abort() at Error
at jsStackTrace (http://localhost:8080/Development/WebGL.js:875:12)
at stackTrace (http://localhost:8080/Development/WebGL.js:889:21)
at abort (http://localhost:8080/Development/WebGL.js:3830852:24)
at _pthread_create (http://localhost:8080/Development/WebGL.js:13183:2)
at __ZN6il2cpp2os10ThreadImpl3RunEPFvPvES2_ [il2cpp::os::ThreadImpl::Run(undefined?F?*, void, void*)] (http://localhost:8080/Development/WebGL.js:3596270:50)
at Array.__ZN6il2cpp2os6Thread3RunEPFvPvES2_ [il2cpp::os::Thread::Run(undefined?F?*, void, void*)] (http://localhost:8080/Development/WebGL.js:3746555:7)
at Object.dynCall_iiii (http://localhost:8080/Development/WebGL.js:3807075:39)
at invoke_iiii (http://localhost:8080/Development/WebGL.js:16008:32)
at Array.__ZN6il2cpp6icalls8mscorlib6System9Threading6Thread15Thread_internalEP12Il2CppThreadP14Il2CppDelegate [il2cpp::icalls::mscorlib::System::Threading::Thread::Thread_internal(Il2CppDelegate?**)] (http://localhost:8080/Development/WebGL.js:2708698:6)
at Object.dynCall_iii (http://localhost:8080/Development/WebGL.js:3813716:38)
我完全不知道这意味着什么,也不知道如何远程解决这个问题。我对服务器技术的兴趣并不是一直以来都很高,所以我们非常希望在这个问题上提供一些帮助。
这是我目前使用的xml上载代码:
FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://localhost/construct.xml");
request.Method = WebRequestMethods.Ftp.UploadFile;
request.Credentials = new NetworkCredential("name", "password");
string xml = xmlDoc.OuterXml;
byte[] bytes = Encoding.UTF8.GetBytes(xml);
Stream requestStream = request.GetRequestStream();
requestStream.Write(bytes, 0, bytes.Length);
requestStream.Close();
FtpWebResponse response = (FtpWebResponse)request.GetResponse();
response.Close();
如果还有什么是我遗漏的,请告诉我。提前感谢!
发布于 2015-05-26 11:52:04
由于WebRequest依赖于线程,所以不可能将HTML5与Unity导出的项目一起使用。团结的导出到HTML5选项不支持线程(目前)。堆栈跟踪的关键部分是:
at _pthread_create (http://localhost:8080/Development/WebGL.js:13183:2)
没有一个p线程API方法是由emscripten实现的。在将来的某个时候,我们可能会从不同的浏览器中获得JavaScript中的线程支持,但现在还没有。
请注意,这在编辑器中确实有效,即使在选择的WebGL平台上也是如此,因为团结并不像对WebGL那样限制WebGL平台的.NET配置文件。我们正在考虑使用概要文件为像WebGL这样的平台提供早期的错误信息,但是我们还没有实现它。
https://stackoverflow.com/questions/30454036
复制相似问题