[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-dev: Re: gEDA-user: New features in gattrib



On Mon, 14 Aug 2006, al davis wrote:

>On Monday 14 August 2006 12:59, Stuart Brorson wrote:
>> However, doing any sort of
>> IPC between gattrib and gschem is not on my radar screen.
>>  Therefore, any discussion of pipes vs. TCP/IP, 802.11g, or
>> OC-192 is pointless. Unless somebody wants to implement it
>> themselves and send me the patches.
>
>That's an invitation for someone else.  Igor?

I think I wouldn't go further than contributing the demo programs, mainly
because I have a nice socket lib in gpmi which I would like to use but I
couldn't (dependencies). I would end up rewriting or ripping that code
instead of using the lib which is pretty much against my taste :)

>Igor:
>How about a pair of little demo programs.  Make one send, the 
>other receive, just to demonstrate the concept.

http://inno.bme.hu/~igor2/tmp/socketing.tar.gz

I've ripped existing code from gpmi_extension which is under the LGPL, so
the demo programs are LGPL too. The server listens using a local socket
/tmp/gEDA.sock which it first unlinks (so you can restart the server and
it will be able to bind the socket again). The server accepts the
first connection then dumps anything it reads prefixing with "> ". 

The client tries to connect then sends the current time every second. On
it's stdout it echoes it so it's easy to check whether the server really
received the same data (prefix is ">> " here.)

I've cut off most of the portability layer (network.h) so it compiles only
on UNIX now but gpmi_extensions version compiles fine on bsd,
solaris, windows (both with cygwin and crosscompiling from Linux using
mingw). 

>My reason for suggesting a pipe is that it looks like a file, so 
>it is trivial to implement.

Besides the listen/accept and the connect parts, actual reading and
writing is the same. This why we like UNIX: everything is a file :)
Setting to nonblocking, using select(2) or poll(2) are all possible using
only a few extra lines.

Regards

Igor2



_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user