-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simplify channels build by making TCP native only
- Loading branch information
Showing
7 changed files
with
38 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
21 changes: 21 additions & 0 deletions
21
Modules/Channels/native/src/test/scala/channels/EchoServerTestTCP.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package channels | ||
|
||
import java.net.{InetAddress, InetSocketAddress, ServerSocket, SocketException} | ||
|
||
class EchoServerTestTCP extends EchoCommunicationTest( | ||
{ ec => | ||
val socket = new ServerSocket | ||
|
||
try socket.setReuseAddress(true) | ||
catch { | ||
case _: SocketException => | ||
// some implementations may not allow SO_REUSEADDR to be set | ||
} | ||
|
||
socket.bind(new InetSocketAddress(InetAddress.getByName("localhost"), 0)) | ||
|
||
val port = socket.getLocalPort | ||
(port, TCP.listen(() => socket, ec)) | ||
}, | ||
ec => port => TCP.connect(TCP.defaultSocket(new InetSocketAddress("localhost", port)), ec) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters