Skip to content

Commit

Permalink
Disconnect TCP connection on EOS (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
wkozyra95 authored Mar 18, 2024
1 parent 474d9fd commit 09f4114
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This package provides TCP Source and Sink, that read and write to TCP sockets.
Add the following line to your `deps` in `mix.exs`. Run `mix deps.get`.

```elixir
{:membrane_tcp_plugin, "~> 0.2.0"}
{:membrane_tcp_plugin, "~> 0.3.0"}
```

## Copyright and License
Expand Down
6 changes: 6 additions & 0 deletions lib/membrane_tcp/sink.ex
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,10 @@ defmodule Membrane.TCP.Sink do

@impl true
defdelegate handle_setup(context, state), to: CommonSocketBehaviour

@impl true
def handle_end_of_stream(_pad, _context, state) do
local_socket = Socket.close(state.local_socket)
{[], %{state | local_socket: local_socket}}
end
end
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Membrane.TCP.MixProject do
use Mix.Project

@version "0.2.0"
@version "0.3.0"
@github_url "https://github.com/membraneframework/membrane_tcp_plugin"

def project do
Expand Down

0 comments on commit 09f4114

Please sign in to comment.