August'24: Kamaelia is in maintenance mode and will recieve periodic updates, about twice a year, primarily targeted around Python 3 and ecosystem compatibility. PRs are always welcome. Latest Release: 1.14.32 (2024/3/24)

Cookbook Example

How can I...?

Examples 12 : Simple TCP based client for the streamer above. Components used:pipeline, TCPClient, SimpleFileWriter

#!/usr/bin/python

from Kamaelia.Internet.TCPClient import TCPClient
from Kamaelia.Util.PipelineComponent import pipeline
from Kamaelia.File.Writing import SimpleFileWriter

outputfile = "/tmp/received.raw"
clientServerTestPort=1500

pipeline(TCPClient("127.0.0.1",clientServerTestPort),
         SimpleFileWriter(outputfile)
        ).run()

Source: Examples/example12/ClientStreamToFile.py