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 private static final ChannelMetadata METADATA = new ChannelMetadata(false, 16);
33
34
35
36
37 protected AbstractServerChannel() {
38 super(null);
39 }
40
41 @Override
42 public ChannelMetadata metadata() {
43 return METADATA;
44 }
45
46 @Override
47 public SocketAddress remoteAddress() {
48 return null;
49 }
50
51 @Override
52 protected SocketAddress remoteAddress0() {
53 return null;
54 }
55
56 @Override
57 protected void doDisconnect() throws Exception {
58 throw new UnsupportedOperationException();
59 }
60
61 @Override
62 protected AbstractUnsafe newUnsafe() {
63 return new DefaultServerUnsafe();
64 }
65
66 @Override
67 protected void doWrite(ChannelOutboundBuffer in) throws Exception {
68 throw new UnsupportedOperationException();
69 }
70
71 @Override
72 protected final Object filterOutboundMessage(Object msg) {
73 throw new UnsupportedOperationException();
74 }
75
76 private final class DefaultServerUnsafe extends AbstractUnsafe {
77 @Override
78 public void connect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) {
79 safeSetFailure(promise, new UnsupportedOperationException());
80 }
81 }
82 }