pyspark.streaming.StreamingContext.socketTextStream¶
- 
StreamingContext.socketTextStream(hostname: str, port: int, storageLevel: pyspark.storagelevel.StorageLevel = StorageLevel(True, True, False, False, 2)) → pyspark.streaming.dstream.DStream[str][source]¶
- Create an input from TCP source hostname:port. Data is received using a TCP socket and receive byte is interpreted as UTF8 encoded - \ndelimited lines.- Parameters
- hostnamestr
- Hostname to connect to for receiving data 
- portint
- Port to connect to for receiving data 
- storageLevelpyspark.StorageLevel, optional
- Storage level to use for storing the received objects