- Home /
Frame skipped when WebRequest.Create() is called for the first time
Hi,
I am going to write an online mini game which makes request to a HTTP server. I won't be using the WWW Unity class because I need to make PUT & DELETE requests which are not supported by WWW. I observed that when WebRequest.Create() is called for the first time, frame skips pretty badly. I've already use AsyncCallBack to retrieve the web response asynchronously. I am just wondering if this behavior is normal and if there's any workaround to it.
Thanks a lot!
Answer by tobiass · Aug 17, 2012 at 02:41 PM
That could be an issue with the default proxy setting. Try this code once, before you do a request:
WebRequest.DefaultWebProxy = null;
If your target platform is the web, you most likely will have to use the WWW class. Afaik, WebRequest is not allowed/supported there (for security reasons?!).
Hi Tobiass thanks for the answer. I tried your code but it doesn't seem to help. $$anonymous$$y target platform is actually iOS and Android. WebRequest has proven to be working, with the frame skip side effect though.
It could be DNS resolution. Try using the IP ins$$anonymous$$d and if that helps, do DNS resolution yourself in another thread.
I've tried using IP addresses only because the problem still exists. It is only observable on iOS and Android, not in the editor mode.