[ipe-discuss] Use of Ipelet with socket

Otfried Cheong otfried at kaist.ac.kr
Mon Jan 23 10:47:26 CET 2006

> I've just written an ipelet to do some drawing in an online manner. The 
> idea is to let the ipelet open a server socket and wait for connection 
> request from a client. Once a connection is established, the ipelet will 
> receive drawing information, such as coordinates of an IpeMark, from the 
> client and draw on the current page.
> I thought this is fairly feasible; however, every time I run the Ipelet, 
> although it was able to create the socket, accept connection request and 
> receive data, IPE just hangs thereafter and does not draw anything at 
> all. The CPU usage was also high when the Ipelet was running.
> I wonder if this kind of use is feasible in IPE. Thank you very much for 
> your help.

I don't think this can be done.  Ipelets have no control over Ipe: it's 
Ipe that calls Ipelets, and updates the display when the Ipelet returns 
control.   If you have a blocking socket, Ipe would hang when the Ipelet 
is called.  If you use non-blocking sockets, or separate threads, you 
would need a way to tell Ipe to update the display when data arrives - 
this is simply not currently possible.

If your goal is to use Ipe as a viewer for some other software, I would 
recommend to write your own main program, using IpeCanvas for display. 
I have some example code that does this.


More information about the Ipe-discuss mailing list