15-02-2012 09:13 PM - edited 15-02-2012 09:13 PM
Has anyone tried to send/receive data over the network from the emulator ?
I am running some code that tries to POST some data over HTTP but seems to fail with a TimeoutException.
It doesn't seem that the data is even sent, it just times out immediately.
Some interesting facts:
What can be the issue ?
Here's a code sample of what I'm running:
// What we are sending string post_data = "api_key=*********&game_id=******&response=XML&username=Me&score=11120"; string uri = "https://www.scoreoid.com/api/createScore"; // Create a request var request = (HttpWebRequest)WebRequest.Create (uri); request.Method = "POST"; request.KeepAlive = false; request.ProtocolVersion = HttpVersion.Version10; // Turn our request string into a byte stream byte[] postBytes = Encoding.ASCII.GetBytes (post_data); // This is important - make sure you specify type this way request.ContentType = "application/x-www-form-urlencoded"; request.ContentLength = postBytes.Length; var requestStream = request.GetRequestStream (); // Now send it requestStream.Write (postBytes, 0, postBytes.Length); requestStream.Close (); var stream = request.GetResponse ().GetResponseStream (); using (var sr = new StreamReader(stream)) { var res = sr.ReadToEnd (); Console.WriteLine (res); }
16-02-2012 04:48 PM - edited 16-02-2012 04:50 PM
Hi liortal,
Thank you very much for raising this with us. From my own tests just now running your code (all be it with a different URL for debugging), and a slightly different implementation, I can confirm that I was not able to reach the destination URL because of a timeout. I was however able to reach it with the same code running on an Xperia Play. I can confirm this works with both GET and POST requests.
We will continue to investigate why this is the case and will update you when we have some more information.
Best regards,
James
on 17-02-2012 07:06 AM
on 17-02-2012 09:01 AM
on 17-02-2012 10:19 AM
FYI, if you are sat behind a proxy server, you can tell HTTPWebRequest to acknowledge it like follows.
// Provide it with a Proxy and a Port to use.
request.Proxy = new WebProxy("12.34.56.78", 8080);I have been able to replicate the problems using the debugger and we're looking into the causes of this. We'll let you know when we have more information.
on 17-02-2012 10:38 AM
21-02-2012 05:20 PM - edited 21-02-2012 05:20 PM
Likewise, I was not able to see any outgoing connections when using the debugger. I have escalated this problem to my colleagues and we'll update you if we have any progress on this.
Best regards,
James.
on 12-03-2012 10:34 PM
on 13-03-2012 09:35 AM
on 21-03-2012 07:47 PM
PSM Developer Registration (for free) on PSM DevPortal is required to post on the forum.
Please sign out then sign in again to the forum and PSM DevPortal after you have completed the registration.
フォーラムへ投稿をするにはPSM DevPortalへの登録(無料)が必要です。
登録後はフォーラムと
PSM DevPortalを一度ログアウトし、再度ログインしてください。


Website ©2013 Sony Computer Entertainment Europe
All content, game titles, trade names and/or trade dress, trademarks, artwork and associated imagery are trademarks and/or copyright material of their respective owners. All rights reserved. [more info]
%%http://community.eu.playstation.com/t5/Announcements/Beta-Trial-Information/td-p/11386362
best_shooter.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_driver.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_performer.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_footballer.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_fighter.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_creator.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_action_player.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
dev2.png%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/Producer-and-Developer-Ranks/td-p/18407352
trophy.gif%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/The-Community-Awards-FAQ/td-p/18407096
PSlogoSM.png%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/Online-Support-Coordinator-rank/td-p/18414870