Skip to content

Commit

Permalink
Merge pull request #32 from barchart/master-ccob
Browse files Browse the repository at this point in the history
* changed some unsupported set operations to use the more fitting except...
  • Loading branch information
Andrei-Pozolotin committed Jan 28, 2013
2 parents 254ce9d + dac405e commit 4170185
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void close() throws IOException {

@Override
public ServerSocketChannel getChannel() {
throw new RuntimeException("feature not available");
throw new UnsupportedOperationException("feature not available");
}

@Override
Expand Down Expand Up @@ -123,7 +123,7 @@ public boolean isClosed() {
@Override
public void setPerformancePreferences(final int connectionTime,
final int latency, final int bandwidth) {
throw new RuntimeException("feature not available");
throw new UnsupportedOperationException("feature not available");
}

// NOTE: set both send and receive, since they are inherited on accept()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ public void connect(final SocketAddress endpoint) throws IOException {
@Override
public void connect(final SocketAddress endpoint, final int timeout)
throws IOException {
throw new RuntimeException("feature not available");
throw new UnsupportedOperationException("feature not available");
}

@Override
public SocketChannel getChannel() {
throw new RuntimeException("feature not available");
throw new UnsupportedOperationException("feature not available");
}

@Override
Expand All @@ -89,7 +89,9 @@ public synchronized InputStream getInputStream() throws IOException {

@Override
public boolean getKeepAlive() throws SocketException {
throw new RuntimeException("feature not available");
// UDT has keep alive automatically under the
// hood which I believe you cannot turn off
return true;
}

@Override
Expand All @@ -113,7 +115,7 @@ public SocketAddress getLocalSocketAddress() {

@Override
public boolean getOOBInline() throws SocketException {
throw new RuntimeException("feature not available");
return false;
}

@Override
Expand Down Expand Up @@ -165,12 +167,12 @@ public int getSoTimeout() throws SocketException {

@Override
public boolean getTcpNoDelay() throws SocketException {
throw new RuntimeException("feature not available");
return false;
}

@Override
public int getTrafficClass() throws SocketException {
throw new RuntimeException("feature not available");
return 0;
}

@Override
Expand Down Expand Up @@ -200,23 +202,23 @@ public boolean isOutputShutdown() {

@Override
public void sendUrgentData(final int data) throws IOException {
throw new RuntimeException("feature not available");
throw new UnsupportedOperationException("feature not available");
}

@Override
public void setKeepAlive(final boolean on) throws SocketException {
throw new RuntimeException("feature not available");
throw new UnsupportedOperationException("feature not available");
}

@Override
public void setOOBInline(final boolean on) throws SocketException {
throw new RuntimeException("feature not available");
throw new UnsupportedOperationException("feature not available");
}

@Override
public void setPerformancePreferences(final int connectionTime,
final int latency, final int bandwidth) {
throw new RuntimeException("feature not available");
throw new UnsupportedOperationException("feature not available");
}

@Override
Expand Down Expand Up @@ -247,12 +249,12 @@ public void setSoTimeout(final int timeout) throws SocketException {

@Override
public void setTcpNoDelay(final boolean on) throws SocketException {
throw new RuntimeException("feature not available");
throw new UnsupportedOperationException("feature not available");
}

@Override
public void setTrafficClass(final int tc) throws SocketException {
throw new RuntimeException("feature not available");
throw new UnsupportedOperationException("feature not available");
}

@Override
Expand Down

0 comments on commit 4170185

Please sign in to comment.