socket library expertise needed
Tim Rowledge (1742) 170 posts |
The latest Squeak systems have been extended to handle IPv6 and so I need to extend my socket module to at least cope gracefully. It seems there isn’t any IPv6 support for RISC OS right now which I doubt really affects very much in practice. However, there are a whole load of extra little bits I need to support. I’ve generally implemented the sockets for Squeak by taking the unix port socket code, banging somewhat randomly at it with assorted #ifdef etc and changing the included header files until it compiles and the web browser/ftp app seem to function. Hardly in the best traditions of quality engineering but it worked well enough when there was only a simple set of requirements. Now however, the unix code has a bunchastuff added and some of it I don’t think I can even pronounce properly. Looking thourgh the code I have spotted two example problems so far: There’s almost certainly more to be found. Is anyone a keen socketeer with knowledge of unixy-land rocketry? The code is freely shareable for anyone interested in helping. For support I have the tcplibs as per the Acorn DDE. I’d be perfectly happy if the solution involved more direct us of the socket SWIs, I’m not at all wedded t othe current code; just the input and output. |
Theo Markettos (89) 919 posts |
How much other Unix stuff is used? UnixLib (part of GCC) provides more complete implementations of a lot of Unix functions – for example, it supports getaddrinfo Realistically this does mean switching to GCC though (the standalone UnixLib for Norcroft is somewhat outdated). Is setLinger() a synonym for setsockopt() with SO_LINGER? Another advantage of using GCCSDK is it can take away some of the build system pain so you can use existing Makefiles, configuration shell scripts etc. |
Tim Rowledge (1742) 170 posts |
Thanks Theo; I don’t use any other unix code, preferring OSLib. I’m not a big fan of life as a developer under unix generally. Been there too often, hated it too frequently. |
Tim Rowledge (1742) 170 posts |
Well Dave the good news is that the ‘new’ IPv6 bits aren’t used as yet and may not be for some time due to issues on one or other of the ‘big’ platforms. So I don’t need to hurry now I’ve stubbed out the functions well enough to shut the compiler up. It would be nice to rewrite it to use the SWI calls directly as much as possible, even if just to learn enough about sockets to be able to do it. I don’t think it would save a great deal of executable code space though – I’ve just looked and the current dynamically loaded socket plugin is a mere 35Kb. In fact the entire virtual machine for Squeak with all the plugins (sound generation and playing, graphics operations, file handing, sockets, FFTs, gesture recognition, JPEG read & write, 3D graphics, zip handling etc) adds up to less than 1Mb! Contrast that to the OS X version (generated from the same source code except for platform specific parts) which weighs in at about 10Mb. |
David J. Ruck (33) 1636 posts |
Perhaps we could get the API defined at the SWI and socketlib level, but left unimplemented. That would at least allow cross platform code to be compiled, and start working when/if RO gets IPv6. |
Tim Rowledge (1742) 170 posts |
Hi Druck (waves from distant shores) I forgot to mention that there is a completely free (as in MIT licence) version of getaddrinfo.c that is intended for systems needing it but lacking IPv6 support. |