Lines Matching refs:channel

77         SctpChannel channel = null;
79 channel = SctpChannel.open();
81 /* TEST 1: empty set if channel is not bound */
82 check(channel.getAllLocalAddresses().isEmpty(),
83 "getAllLocalAddresses returned non empty set for unbound channel");
85 /* TEST 2: null to bind the channel to an automatically assigned
87 channel.bind(null);
89 /* TEST 3: non empty set if the channel is bound */
90 check(!channel.getAllLocalAddresses().isEmpty(),
91 "getAllLocalAddresses returned empty set for bound channel");
92 debug("getAllLocalAddresses on channel bound to the wildcard:\n"
93 + channel.getAllLocalAddresses());
95 /* TEST 4: AlreadyBoundException if this channel is already bound */
96 try { channel.bind(null); }
102 channel.close(); /* open a new unbound channel for test */
103 channel = SctpChannel.open();
104 channel.bind(new UnsupportedSocketAddress());
111 channel.close(); /* open a new unbound channel for test */
112 channel = SctpChannel.open();
113 connectChannel(channel);
114 channel.bind(null);
119 /* TEST 7: ClosedChannelException - If this channel is closed */
121 channel.close(); /* open a new unbound channel for test */
122 channel = SctpChannel.open();
123 channel.close();
124 channel.bind(null);
129 /* TEST 8: ClosedChannelException if channel is closed */
131 channel.getAllLocalAddresses();
141 try { channel.close(); }
147 SctpChannel channel = null;
152 channel = SctpChannel.open();
157 debug("channel.bind( " + a + ")");
158 channel.bind(a);
161 debug("channel.bindAddress(" + ia + ")");
162 channel.bindAddress(ia);
164 if (debug) {Util.dumpAddresses(channel, out);}
167 /* Test with connected channel */
168 peerChannel = connectChannel(channel);
177 check(boundAddress(channel, addr), "trying to remove address that is not bound");
178 channel.unbindAddress(addr);
179 if (debug) {Util.dumpAddresses(channel, out);}
180 check(!boundAddress(channel, addr), "address was not removed");
183 channel.bindAddress(addr);
184 if (debug) {Util.dumpAddresses(channel, out);}
185 check(boundAddress(channel, addr), "address is not bound");
195 channel.bindAddress(againAddress);
207 channel.bindAddress(nla);
216 channel.unbindAddress(againAddress);
217 channel.unbindAddress(againAddress);
229 channel.unbindAddress(nla);
239 channel.shutdown();
253 while((info = channel.receive(buffer, null, handler)) != null) {
256 debug("channel Reached EOF");
265 try { if (channel != null) channel.close(); }
270 boolean boundAddress(SctpChannel channel, InetAddress addr)
272 for (SocketAddress boundAddr : channel.getAllLocalAddresses()) {
279 SctpChannel connectChannel(SctpChannel channel)
281 debug("connecting channel...");
289 channel.connect(addr);
295 debug("Cannot connect channel");