Sockets subclassed from xojo.net.httpSocket don't seem to work on Windows-Can You Test This For Me?

An example of what I get with the classic HTTPSocket can be found at http://developer.xero.com/documentation/getting-started/http-response-codes/#title3.

Don’t know if this is of any help. But I believe there are some updates coming in the next Xojo release that will fix issues with Xojo.Net.HTTPSocket when your app is deployed in Xojo cloud.

No, Xojo.net.httpsocket does not yet work on Xojo Cloud. We’re working on that, but it’s a server issue.

Where did you get his idea?

Chris got that idea from me. I was thinking that he was running into the headers problem but it sounds like it could be something else.

Is this issue fixed ?
I just ran into several App crash on Windows when using Xojo.Net.HTTPSocket.

It seems that calling the following code in the PageReceived event is the reason of the crash.

self.disconnect() self.Send(...)

My app is full of code like that :frowning:

You’re probably getting an exception that the socket is already in use. Use Timer.CallLater to start the next send after the PageReceived event has finished.

Does anyone have a simple example of using TimerCallLater

I am having problems wrapping my head around.

for my attempt see here https://forum.xojo.com/24044-how-to-avoid-socket-already-in-use

Thanks

Tim

[code]Sub PageReceived(URL as Text, HTTPStatus as Integer, Content as xojo.Core.MemoryBlock) Handles PageReceived
try
DIM contentDict As NEW xojo.Core.Dictionary
if (HTTPStatus <> 204) then contentDict = me.mDictionaryFromMemoryBlock(Content)
contentDict.Value(“URL”) = URL
contentDict.Value(“HTTPStatus”) = HTTPStatus

// we use the CallLater so we don't get bit with the "the socket is already making a request" error
Xojo.Core.Timer.CallLater 0, WeakAddressOf mPageReceived, contentDict

catch e As RuntimeException
Raise e
end try
End Sub
[/code]

[code]Private Sub mPageReceived(content As Auto)
try
DIM contentDict As xojo.Core.Dictionary = xojo.Core.Dictionary(content)

catch e As RuntimeException
Raise e
end try
End Sub
[/code]

[code]Protected Function mDictionaryFromMemoryBlock(mb As xojo.Core.MemoryBlock) as xojo.Core.Dictionary
try
DIM asText As Text = Xojo.Core.TextEncoding.UTF8.ConvertDataToText(mb)
Return Xojo.Data.ParseJSON(asText)

catch e As RuntimeException
Raise e
end try
End Function
[/code]