View Javadoc
1   /*
2    * Copyright 2012 The Netty Project
3    *
4    * The Netty Project licenses this file to you under the Apache License,
5    * version 2.0 (the "License"); you may not use this file except in compliance
6    * with the License. You may obtain a copy of the License at:
7    *
8    *   http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations
14   * under the License.
15   */
16  package io.netty.channel.socket;
17  
18  import io.netty.channel.Channel;
19  import io.netty.channel.ChannelFuture;
20  import io.netty.channel.ChannelPromise;
21  
22  import java.net.InetSocketAddress;
23  import java.net.Socket;
24  
25  /**
26   * A TCP/IP socket {@link Channel}.
27   */
28  public interface SocketChannel extends Channel {
29      @Override
30      ServerSocketChannel parent();
31  
32      @Override
33      SocketChannelConfig config();
34      @Override
35      InetSocketAddress localAddress();
36      @Override
37      InetSocketAddress remoteAddress();
38  
39      /**
40       * Returns {@code true} if and only if the remote peer shut down its output so that no more
41       * data is received from this channel.  Note that the semantic of this method is different from
42       * that of {@link Socket#shutdownInput()} and {@link Socket#isInputShutdown()}.
43       */
44      boolean isInputShutdown();
45  
46      /**
47       * @see Socket#isOutputShutdown()
48       */
49      boolean isOutputShutdown();
50  
51      /**
52       * @see Socket#shutdownOutput()
53       */
54      ChannelFuture shutdownOutput();
55  
56      /**
57       * @see Socket#shutdownOutput()
58       *
59       * Will notify the given {@link ChannelPromise}
60       */
61      ChannelFuture shutdownOutput(ChannelPromise future);
62  }