TCP/IP bounty beta release
Pages: 1 2 3 4 5 6 7 8 9 10 11
nemo (145) 2540 posts |
Ooh, fonts. And encodings! Sacrilege… |
Rick Murray (539) 13819 posts |
Are you trolling us again? ;-) |
Matthew Phillips (473) 721 posts |
Yesterday morning some changes to AcornHTTP were committed to the CVS repository, so this morning’s nightly HardDisc4 beta contains AcornHTTP 1.03. This fixes the bug I mentioned further up this thread which was affecting Recce (see bottom of page 8). I’m happy to report that AcornSSL 1.04 and AcornHTTP 1.03 seem to be working very well together. For those who were asking where you get hold of the latest versions of these modules, they are not in the ROM as they form part of the HardDisc4 content. So you will find them in the Nightly Beta HardDisc4 which you can fetch from https://www.riscosopen.org/content/downloads/common Look in System.310.Modules.Network.URL for AcornHTTP and (I don’t take any credit for this: I just reported a problem and helped test the solution.) |
Steve Pampling (1551) 8164 posts |
Testing and giving coherent reports is a skill. “From each according to their ability” to quote. |
André Timmermans (100) 655 posts |
Were can I find the documentation for AcornSSL ? |
Jeffrey Lee (213) 6048 posts |
It’s available in git – https://gitlab.riscosopen.org/RiscOS/Sources/Networking/Fetchers/AcornSSL/blob/master/doc/AcornSSL |
Dave Higton (1515) 3503 posts |
I’m clearly not the only person whose code returns errors in the range specific to AcornSSL (&813F20 to &813F3F), but the docs that Jeffrey referenced above do not state what these errors are. (It’s just the text file that accompanies the beta releases.) Nor do I know what my code should do in response to them. Someone must have assigned these error numbers to particular events, so it follows that that someone must know what they mean. Please enlighten us! I’m sometimes seeing error &813F27 on an AcornSSL_Write. Should I simply retry the operation, is there a better thing to do, or is it fatal? In my case it’s attempting to write the same data to the same destination with a handle that has been newly created without errors. Sometimes it works, sometimes not. I have no idea why it should not behave consistently, nor can I see a pattern. |
Dave Higton (1515) 3503 posts |
With a little experimentation, I have found that error &813F27 can be overcome by re-trying the AcornSSL_Write. I think the same may be true of error &813F26 but I can’t be certain (my code masked off the higher order bits; I saw error 38). It’s still a small sample, so the results I have may not be representative. |
Frank de Bruijn (160) 228 posts |
As long as the error message has (state 76) or (code 76) at the end, AntiSpam treats those two codes as a kind of EWOULDBLOCK (actually, I’ve mapped them to ERECVFAILED as I’ve only seen them on reads). Retrying has worked so far. A (state 9,984) in the message indicates a broken connection. |
Dave Higton (1515) 3503 posts |
Thanks, Frank. I was pretty sure you’d have tried this some time ago and worked round the lack of documentation. |
Dave Higton (1515) 3503 posts |
Does anyone know if AcornSSL takes a few seconds to start up and reach a stable state, and multi-task while it’s doing so? I’ve got an app that is run at machine start-up, and wants to call AcornSSL as it starts up. There is an RMEnsure/RMRun in the !Run file, but if that’s all, the app evaporates without trace. Running it later is fine. The only way I’ve been able to get it to work (and I don’t yet know if this is reliable) is to put the same RMEnsure/RMRun line in the !Boot file and get the app to be looked at before being run. With those observations, my suspicion is that AcornSSL is not ready for use immediately after being RMRun. If anyone else can shed any light on the issue, or attempt to reproduce it independently, I would appreciate it. Edit: Mea culpa. AcornSSL no longer requires RMRun – it’s RMLoad. Problem solved. |
Bryan (8467) 468 posts |
Is the HTTP_Client test app mentioned in this topic still available? I rememember looking at it at the time, but now I can’t find my copy. EDIT: I have found it on a previous Ras Pi – now kept in a cupboard. Apologies to anybody t went looking for it. |
Bryan (8467) 468 posts |
Now I have remembered why I didn’t use it. I doesn’t work if the remote host is not available. It blocks. Does anybody know of a non-blocking version, please? I have read allsorts of posts with outher examples and they are all far too complicated. |
Rick Murray (539) 13819 posts |
What, sockets?
Well, there’s your problem. It is more complicated. To make a socket non blocking, you have to define an integer as value 1, and then set the socket ioctl with value FIONBIO and pass the integer that was set to 1. Then, then there are basically two methods. The first is to write everything in a loop that expects to have the error EWOULDBLOCK returned (means “I’m busy, doing this would block”) and keep trying until it works or some timeout (that you implement) happens. Not that reading zero bytes from an open socket doesn’t mean that there’s no data, it usually means the connection has been terminated. If there’s no data available, you get the EWOULDBLOCK error. Unfortunately Michael’s sockets tutorial (paymentlabs) is no longer… |
Alan Adams (2486) 1147 posts |
There’s a Socketwatch module that helps – it allows a change on a socket to set a pollword, which simplifies the polling code. You may already have it – it’s used by Webjames among other applications. |
Dave Higton (1515) 3503 posts |
Using sockets is complicated. I’ve written several apps using sockets, yet still, every time I write a new one, I have to look all the information up. All I can offer is: don’t be daunted, don’t be discouraged, stick at it. Read and do your best to understand all the examples and source code you can get hold of. Ask questions here – we understand the difficulty you’re facing, we’ve all been there, we are happy to spread our knowledge. |
Bryan (8467) 468 posts |
Thank you for the three responses (and encouragement). I will have annother go at it. But for now, I have taken the easy way out and settled on using Wget. |
Bryan (8467) 468 posts |
OK, I have had another go with this and now have some non-blocking code working
Not perfect, but will do for now. If the connection does not succeed in time, then the error reported by the lack of a successful read will suffice for now. Edited to say |
Sprow (202) 1157 posts |
Does the description in the StrongHelp InetSockets manual not help? It’s not very exciting. |
Steve Pampling (1551) 8164 posts |
Exciting or not, Bryan was expecting the info in the Wiki – thus demonstrating that there is work yet to do on the wiki. Of course now he knows where to find the info, he can remedy the defect. |
Bryan (8467) 468 posts |
Hmmmm. I should check my typing more carefully. Edited many days later to say what I really meant. |
Dave Higton (1515) 3503 posts |
Can I just check something with people who know, please: Does Ioctl FIOASYNC enable the Internet event for a particular socket, and does it do anything else? |
Joseph (8793) 1 post |
According to my observations, it allows it. |
Jeffrey Lee (213) 6048 posts |
I can’t see any code which enables the Internet event. All it does is set some internal flags (SB_ASYNC, SS_ASYNC) to cause the code to generate the event when the right conditions are met. Code for generating the event is here: https://gitlab.riscosopen.org/RiscOS/Sources/Networking/AUN/Internet/-/blob/Internet-5_65/lib/c/unixenv#L146 I think the wiki is up to date wrt the different conditions that will trigger the event (codes 1-3), but I haven’t traced through everything to be sure (e.g. only today I discovered that a new connection on a listen socket will trigger the event, and that’s only because of a one-line note in the LanMan sources, followed by some searching through the Internet sources to verify the claim) |
Pages: 1 2 3 4 5 6 7 8 9 10 11