Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snockets #1499

Merged
merged 33 commits into from
Feb 18, 2020
Merged

Snockets #1499

merged 33 commits into from
Feb 18, 2020

Conversation

coot
Copy link
Contributor

@coot coot commented Jan 24, 2020

This PR introduce snockets which abstract the interface for Berkeley sockets and named pipes (windows).

The PR consist of smaller reviewable and mostly buildable patches.

Highlight of changes:

Win32-network

A bug fixed in System.Win32.Async.connect

network-mux

  • runMuxWithPipes handles named pipes as well
  • new tests which include posix pipes, named pipes and queues
  • mux-demo - windows named pipe demo using mux: an echo server and client

ouroboros-network

  • IOManager - system indepdendent IO manager. On Windows using System.Win32.Async.withIOManager, on posix it's a no-op
  • Snockets - abstraction which handles both Berkeley sockets and Windows named pipes, together with smart constructors for both.
  • Snocket shim layer with type alliases for different paltforms (posix / win32)
  • demo-chain-sync - can now run on Windows with named pipes

future work

  • NodeToClient and NodeToNode which are using named pipes for local clients on windows.

@coot coot requested review from dcoutts and karknu January 24, 2020 07:48
@coot coot force-pushed the coot/snockets branch 4 times, most recently from cdacfc4 to a32a4ed Compare January 27, 2020 18:24
@coot coot mentioned this pull request Jan 28, 2020
@coot coot force-pushed the coot/snockets branch 2 times, most recently from c5ad270 to fea4c5a Compare January 29, 2020 09:53
@coot coot force-pushed the coot/snockets branch 2 times, most recently from d64879d to 69d6206 Compare January 31, 2020 10:18
Copy link
Contributor

@karknu karknu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just minor things.

ouroboros-network/src/Ouroboros/Network/NodeToNode.hs Outdated Show resolved Hide resolved
ouroboros-network/src/Ouroboros/Network/Snocket.hs Outdated Show resolved Hide resolved
@coot coot force-pushed the coot/snockets branch 3 times, most recently from a2ea19c to c0c6e09 Compare February 3, 2020 13:32
, LocalSnocket
, localSnocket
, LocalAddress
, clientAddressFromPath
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be localAddressFromPath?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it should :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

@karknu karknu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

coot added 6 commits February 14, 2020 17:17
Error handler was attached to `putTMVar` instead of the
`Network.Socketconnect` call.
namedPipeAsBearer - create a mux bearer from a named pipe
'PipeChannel' is introduced to abstract read / write pipe operations.
Run pipe tests on windows using `pipeChannelFromNamedPipe` This patch
makes test-network buildable again and enables pipes tests on Windows.
coot added 8 commits February 14, 2020 18:50
Run pipe tests on windows using `pipeChannelFromNamedPipe` This patch
makes test-network buildable again and enables pipes tests on Windows.
This allows to connect to the diffusion layer using unix socket or named
pipe.  Currently we don't support local clients connected using a tcp
socket, but this could be easily added in the future.
This only allows to connect to a node using a unix socket or a named
pipe.
A subscription worker which works over ClientSnocket.  It is integrated
into data diffusion `Ouroboros.Network.Diffusion`.

* `ouroboros-network`   - compiler and runs all its tests on Windows.
* `ouroboros-consensus` - windows support is tracked in #1082
This is useful for running all tests on windows.  Currently it does not
include `ouroboros-consensus` tests, since `ouroboros-consensus` does
not compile on windows.
@coot
Copy link
Contributor Author

coot commented Feb 14, 2020

bors r+

iohk-bors bot added a commit that referenced this pull request Feb 14, 2020
1499: Snockets r=coot a=coot

This PR introduce snockets which abstract the interface for Berkeley sockets and named pipes (windows).

The PR consist of smaller reviewable and mostly buildable patches.

Highlight of changes:

Win32-network
--------------------

A bug fixed in `System.Win32.Async.connect`

network-mux
-----------------

* `runMuxWithPipes` handles named pipes as well
* new tests which include posix pipes, named pipes and queues
* mux-demo - windows named pipe demo using mux: an echo server and client

ouroboros-network
-------------------------

* `IOManager` - system indepdendent IO manager.  On Windows using `System.Win32.Async.withIOManager`, on posix it's a no-op
* `Snockets` - abstraction which handles both Berkeley sockets and Windows named pipes, together with smart constructors for both.
* `Snocket` shim layer with type alliases for different paltforms (posix / win32)
* demo-chain-sync - can now run on Windows with named pipes

future work
---------------
* `NodeToClient` and `NodeToNode` which are using named pipes for local clients on windows.

Co-authored-by: Marcin Szamotulski <[email protected]>
@coot
Copy link
Contributor Author

coot commented Feb 14, 2020

bors +cancel

@coot
Copy link
Contributor Author

coot commented Feb 14, 2020

bors r-

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 14, 2020

Canceled

@coot
Copy link
Contributor Author

coot commented Feb 18, 2020

bors r+

@coot
Copy link
Contributor Author

coot commented Feb 18, 2020

bors try

iohk-bors bot added a commit that referenced this pull request Feb 18, 2020
@coot
Copy link
Contributor Author

coot commented Feb 18, 2020

bors ping

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 18, 2020

pong

@coot
Copy link
Contributor Author

coot commented Feb 18, 2020

bors r+

iohk-bors bot added a commit that referenced this pull request Feb 18, 2020
1499: Snockets r=coot a=coot

This PR introduce snockets which abstract the interface for Berkeley sockets and named pipes (windows).

The PR consist of smaller reviewable and mostly buildable patches.

Highlight of changes:

Win32-network
--------------------

A bug fixed in `System.Win32.Async.connect`

network-mux
-----------------

* `runMuxWithPipes` handles named pipes as well
* new tests which include posix pipes, named pipes and queues
* mux-demo - windows named pipe demo using mux: an echo server and client

ouroboros-network
-------------------------

* `IOManager` - system indepdendent IO manager.  On Windows using `System.Win32.Async.withIOManager`, on posix it's a no-op
* `Snockets` - abstraction which handles both Berkeley sockets and Windows named pipes, together with smart constructors for both.
* `Snocket` shim layer with type alliases for different paltforms (posix / win32)
* demo-chain-sync - can now run on Windows with named pipes

future work
---------------
* `NodeToClient` and `NodeToNode` which are using named pipes for local clients on windows.

Co-authored-by: Marcin Szamotulski <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 18, 2020

Build failed

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 18, 2020

@karknu
Copy link
Contributor

karknu commented Feb 18, 2020

bors r+

iohk-bors bot added a commit that referenced this pull request Feb 18, 2020
1499: Snockets r=karknu a=coot

This PR introduce snockets which abstract the interface for Berkeley sockets and named pipes (windows).

The PR consist of smaller reviewable and mostly buildable patches.

Highlight of changes:

Win32-network
--------------------

A bug fixed in `System.Win32.Async.connect`

network-mux
-----------------

* `runMuxWithPipes` handles named pipes as well
* new tests which include posix pipes, named pipes and queues
* mux-demo - windows named pipe demo using mux: an echo server and client

ouroboros-network
-------------------------

* `IOManager` - system indepdendent IO manager.  On Windows using `System.Win32.Async.withIOManager`, on posix it's a no-op
* `Snockets` - abstraction which handles both Berkeley sockets and Windows named pipes, together with smart constructors for both.
* `Snocket` shim layer with type alliases for different paltforms (posix / win32)
* demo-chain-sync - can now run on Windows with named pipes

future work
---------------
* `NodeToClient` and `NodeToNode` which are using named pipes for local clients on windows.

Co-authored-by: Marcin Szamotulski <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 18, 2020

@iohk-bors iohk-bors bot merged commit 810dba2 into master Feb 18, 2020
@iohk-bors iohk-bors bot deleted the coot/snockets branch February 18, 2020 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants