1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty.channel;
17
18 import java.net.SocketAddress;
19
20
21
22
23
24
25
26
27
28
29
30
31 public abstract class AbstractServerChannel extends AbstractChannel implements ServerChannel {
32
33 private static final ChannelMetadata METADATA = new ChannelMetadata(false);
34
35
36
37
38 protected AbstractServerChannel() {
39 super(null);
40 }
41
42 @Override
43 public ChannelMetadata metadata() {
44 return METADATA;
45 }
46
47 @Override
48 public SocketAddress remoteAddress() {
49 return null;
50 }
51
52 @Override
53 protected SocketAddress remoteAddress0() {
54 return null;
55 }
56
57 @Override
58 protected void doDisconnect() throws Exception {
59 throw new UnsupportedOperationException();
60 }
61
62 @Override
63 protected AbstractUnsafe newUnsafe() {
64 return new DefaultServerUnsafe();
65 }
66
67 @Override
68 protected void doWrite(ChannelOutboundBuffer in) throws Exception {
69 throw new UnsupportedOperationException();
70 }
71
72 @Override
73 protected final Object filterOutboundMessage(Object msg) {
74 throw new UnsupportedOperationException();
75 }
76
77 private final class DefaultServerUnsafe extends AbstractUnsafe {
78 @Override
79 public void connect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) {
80 safeSetFailure(promise, new UnsupportedOperationException());
81 }
82 }
83 }