1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty.channel.epoll;
17
18 import io.netty.buffer.ByteBuf;
19
20 import java.net.InetSocketAddress;
21
22
23
24
25 @Deprecated
26 public final class SegmentedDatagramPacket extends io.netty.channel.unix.SegmentedDatagramPacket {
27
28
29
30
31
32
33
34
35 public SegmentedDatagramPacket(ByteBuf data, int segmentSize, InetSocketAddress recipient) {
36 super(data, segmentSize, recipient);
37 checkIsSupported();
38 }
39
40
41
42
43
44
45
46
47 public SegmentedDatagramPacket(ByteBuf data, int segmentSize,
48 InetSocketAddress recipient, InetSocketAddress sender) {
49 super(data, segmentSize, recipient, sender);
50 checkIsSupported();
51 }
52
53
54
55
56 public static boolean isSupported() {
57 return Epoll.isAvailable() &&
58
59 Native.IS_SUPPORTING_SENDMMSG && Native.IS_SUPPORTING_UDP_SEGMENT;
60 }
61
62 @Override
63 public SegmentedDatagramPacket copy() {
64 return new SegmentedDatagramPacket(content().copy(), segmentSize(), recipient(), sender());
65 }
66
67 @Override
68 public SegmentedDatagramPacket duplicate() {
69 return new SegmentedDatagramPacket(content().duplicate(), segmentSize(), recipient(), sender());
70 }
71
72 @Override
73 public SegmentedDatagramPacket retainedDuplicate() {
74 return new SegmentedDatagramPacket(content().retainedDuplicate(), segmentSize(), recipient(), sender());
75 }
76
77 @Override
78 public SegmentedDatagramPacket replace(ByteBuf content) {
79 return new SegmentedDatagramPacket(content, segmentSize(), recipient(), sender());
80 }
81
82 @Override
83 public SegmentedDatagramPacket retain() {
84 super.retain();
85 return this;
86 }
87
88 @Override
89 public SegmentedDatagramPacket retain(int increment) {
90 super.retain(increment);
91 return this;
92 }
93
94 @Override
95 public SegmentedDatagramPacket touch() {
96 super.touch();
97 return this;
98 }
99
100 @Override
101 public SegmentedDatagramPacket touch(Object hint) {
102 super.touch(hint);
103 return this;
104 }
105
106 private static void checkIsSupported() {
107 if (!isSupported()) {
108 throw new IllegalStateException();
109 }
110 }
111 }