Edit of I/O docs. Fixes #3047

This commit is contained in:
Rich Dougherty 2013-02-17 13:38:06 +13:00
parent 5e54ddaa67
commit 3f31015091
4 changed files with 223 additions and 127 deletions

View file

@ -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) {

View file

@ -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) {