It is worth noting that with this change, I have moved all networking words to a
network
vocabulary. I updated all contributed libraries and made sure they load.The UDP words are very simple to use.
<datagram> ( port -- datagram )
creates a datagram socket bound to a specific port. Passing 0 binds to the first available port.send ( packet host addr datagram -- )
sends a UDP packet. The packet must be given as a byte array.receive ( datagram -- packet host addr )
waits to receive a UDP packet.That is all. I've only tested them lightly, however Ivan's original code was known to work so I don't expect any major problems here.
Another contributor is currently working on support for Unix domain sockets and IPv6. This will round out Factor's networking capabilities quite nicely and put them on par with other languages.
No comments:
Post a Comment