Merge pull request #1135 from akka/wip-3047-edit-io-docs-rich
Edit of I/O docs. Fixes #3047
This commit is contained in:
commit
65ef38d405
4 changed files with 223 additions and 127 deletions
|
|
@ -38,13 +38,14 @@ public class IODocTest {
|
|||
final InetSocketAddress remoteAddr = new InetSocketAddress("127.0.0.1",
|
||||
12345);
|
||||
tcp.tell(TcpMessage.connect(remoteAddr), getSelf());
|
||||
// or with socket options
|
||||
//#connect
|
||||
//#connect-with-options
|
||||
final InetSocketAddress localAddr = new InetSocketAddress("127.0.0.1",
|
||||
1234);
|
||||
final List<Inet.SocketOption> options = new ArrayList<Inet.SocketOption>();
|
||||
options.add(TcpSO.keepAlive(true));
|
||||
tcp.tell(TcpMessage.connect(remoteAddr, localAddr, options), getSelf());
|
||||
//#connect
|
||||
//#connect-with-options
|
||||
} else
|
||||
//#connected
|
||||
if (msg instanceof Tcp.Connected) {
|
||||
|
|
|
|||
|
|
@ -38,14 +38,15 @@ public class UdpConnDocTest {
|
|||
final InetSocketAddress remoteAddr =
|
||||
new InetSocketAddress("127.0.0.1", 12345);
|
||||
udp.tell(UdpConnMessage.connect(handler, remoteAddr), getSelf());
|
||||
// or with socket options
|
||||
//#connect
|
||||
//#connect-with-options
|
||||
final InetSocketAddress localAddr =
|
||||
new InetSocketAddress("127.0.0.1", 1234);
|
||||
final List<Inet.SocketOption> options =
|
||||
new ArrayList<Inet.SocketOption>();
|
||||
options.add(UdpSO.broadcast(true));
|
||||
udp.tell(UdpConnMessage.connect(handler, remoteAddr, localAddr, options), getSelf());
|
||||
//#connect
|
||||
//#connect-with-options
|
||||
} else
|
||||
//#connected
|
||||
if (msg instanceof UdpConn.Connected) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue