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

Remove synchronized from Socket overrides #2337

Merged
merged 1 commit into from
Feb 22, 2024
Merged
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
14 changes: 7 additions & 7 deletions src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@ public int getPort() {
}

@Override
public synchronized int getReceiveBufferSize() throws SocketException {
public int getReceiveBufferSize() throws SocketException {
return tdsChannel.tcpSocket.getReceiveBufferSize();
}

Expand All @@ -1455,7 +1455,7 @@ public boolean getReuseAddress() throws SocketException {
}

@Override
public synchronized int getSendBufferSize() throws SocketException {
public int getSendBufferSize() throws SocketException {
return tdsChannel.tcpSocket.getSendBufferSize();
}

Expand All @@ -1465,7 +1465,7 @@ public int getSoLinger() throws SocketException {
}

@Override
public synchronized int getSoTimeout() throws SocketException {
public int getSoTimeout() throws SocketException {
return tdsChannel.tcpSocket.getSoTimeout();
}

Expand Down Expand Up @@ -1536,19 +1536,19 @@ public void connect(SocketAddress endpoint, int timeout) throws IOException {
// Ignore calls to methods that would otherwise allow the SSL socket
// to directly manipulate the underlying TCP socket
@Override
public synchronized void close() throws IOException {
public void close() throws IOException {
if (logger.isLoggable(Level.FINER))
logger.finer(logContext + " Ignoring close");
}

@Override
public synchronized void setReceiveBufferSize(int size) throws SocketException {
public void setReceiveBufferSize(int size) throws SocketException {
if (logger.isLoggable(Level.FINER))
logger.finer(toString() + " Ignoring setReceiveBufferSize size:" + size);
}

@Override
public synchronized void setSendBufferSize(int size) throws SocketException {
public void setSendBufferSize(int size) throws SocketException {
if (logger.isLoggable(Level.FINER))
logger.finer(toString() + " Ignoring setSendBufferSize size:" + size);
}
Expand All @@ -1566,7 +1566,7 @@ public void setSoLinger(boolean on, int linger) throws SocketException {
}

@Override
public synchronized void setSoTimeout(int timeout) throws SocketException {
public void setSoTimeout(int timeout) throws SocketException {
tdsChannel.tcpSocket.setSoTimeout(timeout);
}

Expand Down
Loading