Hi Chhil,

If you do not care about any incoming data from the TCP server Sink.ignore 
should be fine (it will accept but discard any data from the server).

--
Johan
Akka Team

On Friday, July 29, 2016 at 12:48:52 PM UTC+2, murtuza chhil wrote:
>
>
> Hi,
>
> I am an Akka newbie trying to get my head around streams.
>
> In the following working snippet, if I have a netcat server running I can 
> get the client to send the bytes across.
>
> The sink.ignore that I added is simply because I needed a sink to connect 
> to to run the graph. Is that really needed and how would I run something 
> without it because as I see it, 
> I have a source and a the flow created by the Tcp.get(....), that should 
> be sufficient to send the data. 
>
> Did have a look at the TCpEcho example, but I want to do it without the 
> runfold.
>
> ```
> Flow<ByteString, ByteString, CompletionStage<OutgoingConnection>> flow = 
> Tcp
> .get(system).outgoingConnection("127.0.0.1", 6000);
> Source<ByteString, NotUsed> clientSource = Source.single(ByteString
> .fromString("Chhil"));
> clientSource.via(flow).to(Sink.ignore()).run(mat);
> ```
>
> -chhil
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to