May be you can use this code for your purpose
https://gist.github.com/akhld/4286df9ab0677a555087 It basically sends the
content of the given file through Socket (both IO/NIO), i used it for a
benchmark between IO and NIO.

Thanks
Best Regards

On Wed, Mar 11, 2015 at 11:36 AM, Cui Lin <cui....@hds.com> wrote:

>   Dear all,
>
>  I tried the socketTextStream to receive message from a port, similar to
> WordCount example, using
> socketTextStream(host, ip.toInt, StorageLevel.MEMORY_AND_DISK_SER)…
>
>  The problem is that I can only receive messages typed from “nc –lk [port
> no.] from my localhost, while the messages sent from other host to that
> port were ignored.
>
>  I can see all messages from “nc –l [port no.]", why such thing could
> happen?
>
>
>  Best regards,
>
>  Cui Lin
>

Reply via email to