Reading byte[] from socket

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Reading byte[] from socket

Paolo Cristofanelli
Hi,

I would like to read a stream of byte[] from a socket. I know the "writeToSocket" function that allows you to specify a serialization schema to write your stream. 

I would like to do the same but for reading, specifying a deserialization schema that allows me to retrieve a stream of the class I have written before.

Best Regards
Paolo
Reply | Threaded
Open this post in threaded view
|

Re: Reading byte[] from socket

Fabian Hueske-2
Hi Paolo,

have a look at SocketTextStreamFunction [1] which is internally used when StreamExecutionEnviornment.socketTextStream() is called.

Best, Fabian

[1] https://github.com/apache/flink/blob/master/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/SocketTextStreamFunction.java

2017-07-29 13:27 GMT+02:00 Paolo Cristofanelli <[hidden email]>:
Hi,

I would like to read a stream of byte[] from a socket. I know the "writeToSocket" function that allows you to specify a serialization schema to write your stream. 

I would like to do the same but for reading, specifying a deserialization schema that allows me to retrieve a stream of the class I have written before.

Best Regards
Paolo