Exemplo n.º 1
0
    def __init__(self, noServer=False, serverPort=None, **dictArgs):
        """particleTypes = dictionary mapping names to particle classes
        
           All remaining named arguments are passed onto the TopologyViewerComponent
        """

        from Kamaelia.SingleServer import SingleServer
        from Kamaelia.Util.ConsoleEcho import consoleEchoer

        pipe = [
            chunks_to_lines(),
            lines_to_tokenlists(),
            TopologyViewerComponent(**dictArgs),
            consoleEchoer()
        ]

        if not noServer:
            if serverPort == None:
                serverPort = 1500
            pipe.insert(0, SingleServer(port=serverPort))

        super(TopologyViewerServer, self).__init__(*pipe)
Exemplo n.º 2
0
#!/usr/bin/python

from Kamaelia.Util.PipelineComponent import pipeline
from Record import AlsaRecorder
from Play import AlsaPlayer
from Kamaelia.SingleServer import SingleServer
from Kamaelia.Internet.TCPClient import TCPClient

pipeline(
    AlsaRecorder(),
    SingleServer(port=1601),
).activate()

pipeline(
    TCPClient("127.0.0.1", 1601),
    AlsaPlayer(),
).run()
Exemplo n.º 3
0
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Splitting server. This expects a single inbound connection on one port and spits it out to all recipients who connect on another port. This can be
used as an alternate server for the TCPRelayMulticast to connect to, and
it would expect to be fed using MulticastTCPClientRelay.

"""

from Kamaelia.Util.Backplane import Backplane, publishTo, subscribeTo
from Kamaelia.Util.PipelineComponent import pipeline
from Kamaelia.SimpleServerComponent import SimpleServer
from Kamaelia.SingleServer import SingleServer
from config import tcp_tcp_splitter_port, tcp_splitter_client_port

p = Backplane("Splitting").activate()

pipeline(
    SingleServer(tcp_tcp_splitter_port),
    publishTo("Splitting"),
).activate()


def SubscribeToSplitData():  # Protocol handler for each connected client
    return subscribeTo("Splitting")


SimpleServer(SubscribeToSplitData, tcp_splitter_client_port).run()
Exemplo n.º 4
0
def dumping_server():
    return pipeline(
        SingleServer(1700),
        printer(),
    )
Exemplo n.º 5
0
 def dumping_server():
     return pipeline(
         SingleServer(mockserverport),
         printer(),
     )
Exemplo n.º 6
0
                result.append(chr(mixed_lsb))
                result.append(chr(mixed_msb))

        except IndexError:
            print "WARNING: odd (not even) packet size"
        return "".join(result)


Backplane("DJ1").activate()
Backplane("DJ2").activate()
Backplane("music").activate()
Backplane("destination").activate()

pipeline(
    SingleServer(port=dj1port),
    publishTo("DJ1"),
).activate()

pipeline(
    SingleServer(port=dj2port),
    publishTo("DJ2"),
).activate()

pipeline(
    SingleServer(port=musicport),
    publishTo("music"),
).activate()

livecontrol = 1
networkserve = 0