Socket - UnBind?
John Sandgrounder (1650) 574 posts |
I have been experimenting with a TCP/IP server (again!) I now have very simple server (in BASIC) which will respond to web browser requests with a reponse of Hello World, no matter what the request is for. So far, so good. But when the task exits, the sockets are closed but it does not clear the Bind. Any ideas what I am missing? |
Colin (478) 2433 posts |
Not sure what you mean by ‘does not clear the bind’. Presumably you have closed the server socket and any accepted socket when you exit? |
Rick Murray (539) 13405 posts |
John, that’s normal behaviour. You need to specify “reuse”. Take a look at this: https://www.heyrick.co.uk/blog/index.php?diary=20160104 |
John Sandgrounder (1650) 574 posts |
@Colin, Yes, I have closed the server socket and any accepted socket. Update: I was using a value of 5 for the second parameter of Socket_Listen. When I change that value to 1, I can then exit the program and restart it without getting a Bind socket in use error. That will probably do for me as I do not need to deal with more than 1 request at a time. But I would still be interested in what is going on. @Rick, Thank you for that. I will need to digest that before going further. (particularly as it is C.) |
Colin (478) 2433 posts |
If you want the complicated explanation try this |
Colin Ferris (399) 1748 posts |
Is there a Stronghlp Manual for the AcornSSL module or info on the SWI Thanks.
|
Rick Murray (539) 13405 posts |
The great Google says the only RISC OS related “HTTPS_Connect” is your posting. Hmm… I have no StrongHelp manuals in my collection that cover this. Looking at the SWIs, I would imagine they more or less map to the same as the Socket_* SWIs, with HTTPS_Socket probably being a stand-in for Socket_Creat. There will probably be some sort of running “error status” while establishing a secure connection (looking to see what error is returned should indicate if this is the case). Do you have any example code that uses these SWIs? Typically Socket_Creat is called with the parameters 2,1,0 in R0-R2. That’s PF_INET/AF_INET, SOCK_STREAM, default. I’m guessing that this is the standard SSL module that was supplied in the RISC OS 3.x days (and baked into the original Bush box)? Acorn SSL 3, 0.06 28-Jul-1998 or similar? That’s the one in !System in my RedSquirrel installation. |
Matthew Phillips (473) 687 posts |
There is documentation on the AcornSSL module included in the recent alpha release of the updated module |
Frank de Bruijn (160) 224 posts |
That’s the old one. The current one is here: https://www.riscosopen.org/zipfiles/beta/TCP-IP_Beta2.zip |