octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sockets


From: John Swensen
Subject: Re: sockets
Date: Tue, 15 May 2007 20:43:28 -0400
User-agent: Thunderbird 2.0.0.0 (Macintosh/20070326)

Paul Kienzle wrote:

On May 14, 2007, at 8:25 PM, Tom Holroyd wrote:

I finally added the sockets package to the octave-forge CVS (in main/sockets).

This allows only fairly rudimentary socket support at the moment.
You can send byte strings back and forth.

The testing code uses num2str and so on, and there are some routines for serializing a matrix; the recent changes to int8() allowing strings would make that even easier. Eventually it should be changed to handle more types natively.


listen/send in sockets will conflict with listen/send in miscellaneous.

I'm not sure if I'm the only one using it, but changing will mean user retraining. I'll ask on octave-help.

You may want to make send/recv reliable --- from my reading of the man pages the functions can stop before all the requested bytes are read.

In general I prefer a higher level interfaces (e.g., Tcl) which hides the complexity of dealing with operating systems rather than a low level interface (e.g., Python). This is especially bad when different operating systems provide different interfaces, and the scripting language blindly projects them into the scripts, making the developer test for specific systems in their code.

- Paul


I didn't realize there were existing methods for socket communications. After looking at them, they seem more like they should have an "rpc_" prefix or something like that. I made these functions act as closely to the POSIX version of the functions as possible. I should extend them by making a socket_server and socket_client in m-files on top of them, but still think the lower level should be left intact for those with other needs. I also plan on modifying send/recv to handle different datatypes, including structures.

I can, however, easily put a "socket_" prefix on all the functions in the socket package if you want me to. Just let me know what the consensus is.

John Swensen



reply via email to

[Prev in Thread] Current Thread [Next in Thread]