Trees | Indices | Help |
---|
|
Concrete class remote.Sink
This Plan subclass may be used to relay via UDP JoyApp events (including all pygame events) from a remote.Source running in another JoyApp, potentially on another machine.
Events are serialized into a JSON string and sent over separate UDP packets. TIMEREVENTS are ignored.
Additionally, any JSON packets that contain dictionaries without the 'type' key may be shunted to a separate queue, for application specific processing. This queue is windowed in time, i.e. will hold at most X seconds worth of packets, as specified by the allowMisc constructor parameter. Its contents are accessible via queueIter().
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from |
|
|||
DEFAULT_BINDING = '0.0.0.0', DEFAULT_PORT
|
|
|||
Inherited from |
|
Attributes: bnd -- 2-tuple -- binding address for socket, in socket library format rate -- integer -- maximal number of events processed each time-slice sock -- socket / None -- socket only exists while plan is running convert -- callable -- convert incoming event dictionaries. Allows remote joysticks/keys to be remapped. Returns None if event should be ignored By default, only KEYUP and KEYDOWN events are allowed allowMisc -- float / None -- number of seconds of "misc" packets to store in self.queue or None to disallow non-event packets
|
(default) Override this method to perform operations when Plan starts but before the first events are processed.
|
(default) Override this method to perform operations when Plan terminates.
|
Set the socket binding address. Will take effect next time the plan is started |
(default) Event handler. Override this method to handle all events that were push()-ed to this Plan. The sequential behavior() in this plan only runs if onEvent returned True. All Plan-s recieve a copy of all TIMEREVENT events. If your sequential code does not need any other events, and just wants to execute in parallel with other Plan-s, it is safe to leave the default onEvent method, which always returns True NOTE: onEvent MUST return True or False. Other values raise an exception at runtime.
|
Iterate over the custom packets in the queue Yields pairs (ts, pkt) ts -- float -- arrival time pkt -- dictionary -- packet contents |
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu Jan 4 16:46:17 2018 | http://epydoc.sourceforge.net |