1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.newsclub.net.unix;
19
20 import java.io.FileDescriptor;
21 import java.io.IOException;
22 import java.net.Socket;
23 import java.net.SocketException;
24
25 class AFUNIXSocketImpl extends AFSocketImpl<AFUNIXSocketAddress> {
26 protected AFUNIXSocketImpl(FileDescriptor fdObj) {
27 super(AFUNIXSocketAddress.AF_UNIX, fdObj);
28 }
29
30
31
32
33
34
35
36 static final class Lenient extends AFUNIXSocketImpl {
37 Lenient(FileDescriptor fdObj) throws SocketException {
38 super(fdObj);
39 }
40
41 @Override
42 public void setOption(int optID, Object value) throws SocketException {
43 super.setOptionLenient(optID, value);
44 }
45
46 @Override
47 public Object getOption(int optID) throws SocketException {
48 return super.getOptionLenient(optID);
49 }
50 }
51
52 AFUNIXSocketCredentials getPeerCredentials() throws IOException {
53 return NativeUnixSocket.peerCredentials(fd, new AFUNIXSocketCredentials());
54 }
55
56 final FileDescriptor[] getReceivedFileDescriptors() {
57 return ancillaryDataSupport.getReceivedFileDescriptors();
58 }
59
60 final void clearReceivedFileDescriptors() {
61 ancillaryDataSupport.clearReceivedFileDescriptors();
62 }
63
64 final void receiveFileDescriptors(int[] fds) throws IOException {
65 ancillaryDataSupport.receiveFileDescriptors(fds);
66 }
67
68 final void setOutboundFileDescriptors(FileDescriptor... fdescs) throws IOException {
69 ancillaryDataSupport.setOutboundFileDescriptors(fdescs);
70 }
71
72 final boolean hasOutboundFileDescriptors() {
73 return ancillaryDataSupport.hasOutboundFileDescriptors();
74 }
75 }