The following document contains the results of PMD's CPD 4.2.5.
| File | Line |
|---|---|
| org/bluecove/socket/LocalServerSocket.java | 105 |
| org/bluecove/socket/LocalSocket.java | 328 |
}
/**
* Enable/disable the SO_PASSCRED socket option.
*
* @param on
* @throws SocketException
*/
public void setReceiveCredentials(boolean on) throws SocketException {
if (isClosed()) {
throw new SocketException("Socket is already closed");
}
impl.setOption(LocalSocketOptions.SO_PASSCRED, Integer.valueOf((on?1:0)));
}
public boolean getReceiveCredentials() throws SocketException {
if (isClosed()) {
throw new SocketException("Socket is already closed");
}
Object value = impl.getOption(LocalSocketOptions.SO_PASSCRED);
if (value instanceof Integer) {
return (((Integer) value).intValue() > 0);
} else {
return false;
}
}
}
| |