Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete TODO to fix WebSocket RemoteEndpoint API in Jetty 12 #8598

Merged
merged 3 commits into from
Sep 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ public interface RemoteEndpoint
* @param fragment the text being sent
* @param isLast true if this is the last piece of the partial bytes
* @param callback callback to notify of success or failure of the write operation
* @throws IOException this never throws IOException, it was a mistake to have this in the signature.
*/
void sendPartialString(String fragment, boolean isLast, WriteCallback callback) throws IOException;
void sendPartialString(String fragment, boolean isLast, WriteCallback callback);

/**
* Send a Ping message containing the given application data to the remote endpoint, blocking until all of the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ public void sendPartialString(String fragment, boolean isLast) throws IOExceptio
b.block(getBlockingTimeout(), TimeUnit.MILLISECONDS);
}

// FIXME: Remove the throws IOException from API for this method in the next major release.
@Override
public void sendPartialString(String fragment, boolean isLast, WriteCallback callback)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

package org.eclipse.jetty.ee10.websocket.tests;

import java.io.IOException;
import java.net.URI;
import java.nio.ByteBuffer;
import java.util.Objects;
Expand Down Expand Up @@ -62,14 +61,7 @@ public void onWebSocketPartialBinary(ByteBuffer payload, boolean fin)
@Override
public void onWebSocketPartialText(String payload, boolean fin)
{
try
{
session.getRemote().sendPartialString(payload, fin, WriteCallback.NOOP);
}
catch (IOException e)
{
throw new IllegalStateException(e);
}
session.getRemote().sendPartialString(payload, fin, WriteCallback.NOOP);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ public interface RemoteEndpoint
* @param fragment the text being sent
* @param isLast true if this is the last piece of the partial bytes
* @param callback callback to notify of success or failure of the write operation
* @throws IOException this never throws IOException, it was a mistake to have this in the signature.
*/
void sendPartialString(String fragment, boolean isLast, WriteCallback callback) throws IOException;
void sendPartialString(String fragment, boolean isLast, WriteCallback callback);

/**
* Send a Ping message containing the given application data to the remote endpoint, blocking until all of the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ public void sendPartialString(String fragment, boolean isLast) throws IOExceptio
b.block(getBlockingTimeout(), TimeUnit.MILLISECONDS);
}

// FIXME: Remove the throws IOException from API for this method in the next major release.
@Override
public void sendPartialString(String fragment, boolean isLast, WriteCallback callback)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

package org.eclipse.jetty.ee9.websocket.tests;

import java.io.IOException;
import java.net.URI;
import java.nio.ByteBuffer;
import java.util.Objects;
Expand Down Expand Up @@ -62,14 +61,7 @@ public void onWebSocketPartialBinary(ByteBuffer payload, boolean fin)
@Override
public void onWebSocketPartialText(String payload, boolean fin)
{
try
{
session.getRemote().sendPartialString(payload, fin, WriteCallback.NOOP);
}
catch (IOException e)
{
throw new IllegalStateException(e);
}
session.getRemote().sendPartialString(payload, fin, WriteCallback.NOOP);
}
}

Expand Down