Broadcast server
I would like to write a server with the low level API of python ( socket+select and/or socket+thread ) that allow me to register client and update them every X seconds ( could be the time, the temperature, a stock quote, a message , ... ). How to write the server that keep hot connections with clients and update them when events are trigerred. I don't know how to begin this , i look at the python doc but the doc is more related to client updating the server and i am not sure of the right design that could be use here. Thx Manu -- http://mail.python.org/mailman/listinfo/python-list
Re: Broadcast server
Hi Matt , It sounds very interesting and i will definitely take a deeper look but i was more considering something simpler as a learning exercise more that finding a package that should already do what i want to achieve. I want to find the basic guidelines to write that kind of client/server architecture and make some tests of different solutions(socket+select or socket+thread or mix of them) Your project seems very great and will try to read in to learn. -- http://mail.python.org/mailman/listinfo/python-list
Re: Broadcast server
Yes but before going deeper ( too deep ) i would like to play with a toy python example. Basically what i want to study first is a socket or socket+select server and 5 clients that get time updated from the server. Don't really know how to keep hot connections without blocking the server ? If someone can show me a quick and dirty example of the client/server i'll apprciate it a lot. Thx Manu -- http://mail.python.org/mailman/listinfo/python-list
Re: Broadcast server
Thx Alex, This is exactly what i want to look at . Async will definitely be something i will look at . Does it make sense to mix async and threaded server ( let say a threaded server accepting max 10 connections and dealing with client request asynchronously ). Does it sounds you a good design. Of course i will have a look a twisted that sounds me doing all the job ( for sure better that i can do ) . Thx Manu -- http://mail.python.org/mailman/listinfo/python-list
PumpMessages et WM_QUIT
I have a COM server that throw events that i catch after running the event loop thanks to pythoncom.PumpMessages(). How can i stop and exit this loop? I tried to use win32api.PostQuitMessage() but this has no effect ( the doc says that WM_QUIT stops the PumpMessages loop but it doesn't) Does someone know how to exit gracefully from this loop? Thx Manu -- http://mail.python.org/mailman/listinfo/python-list
Tkinter and ActiveX event
Hi, I want to integrate into an GUI a activeX component that generate some events. What i have done is : - Create the activeX component ( DispatchWithEvents method ) - create the GUI - app.mainloop() My pb is that i don't know how to take into account the events generated by the activeX component into my Tk app main loop to update the GUI for ex. Can someone spot me an example or give some clues? Thx Manu -- http://mail.python.org/mailman/listinfo/python-list
Tk eventloop
Hi I try/struggle to use an ActiveX component in a Tk app. When i execute it i can catch the first event and then when i try to change the value of the w widget everything blocks and nothing is updated anymore. Does someone have an idea of what is wrong and how to smartly integrate these events with the Tk event loop. Thx Manu import win32com.client import pythoncom import MyComponent from Tkinter import * class Event1(MyComponent.IEvents): def OnUpdate(self, ItemName, UserTag): global w v = ptrAx.getV(ItemName) print "%s" % v w.configure(text='a') root = Tk() w = Label(root,text="test") w.pack() ptrAx = win32com.client.DispatchWithEvents(r'MyComponent',Event1) ptrAx.StartUpdates() root.mainloop() -- http://mail.python.org/mailman/listinfo/python-list
Problem with smart pointers
Hello,
I use the Boost.Python lib for a couple of weeks now and i am
facing a pb.
To sum up i have a small hierarchy of objects and have a factory to
build concrete object. The pb is i think aroud the auto_ptr object that
is not correctly managed by my code ( i use version 1.33 )
I think that the solution is obvious but i can't sort it out. If you
could have a look at this small test
struct X
{
virtual int fun1() = 0;
int fun2() { return 2;}
virtual int fun3() { return -1; }
};
struct Y : public X
{
int fun1() {return 1;}
virtual fun3() { return 3; }
};
struct FactY
{
static std:auto_ptr create() { return std:auto_ptr(new Y());}
};
BOOST_PYTHON_MODULE(hello)
{
class_("X",no_init);
class_ >("Y")
.def("fun1",&Y::fun1)
.def("fun2",&Y::fun2)
.def("fun3",&Y::fun3)
;
class_("FactY",no_init)
.def("create",&FactY::create)
.staticmethod("create")
;
}
Many Thx
--
http://mail.python.org/mailman/listinfo/python-list
