Skip to content

Commit

Permalink
Synchronized writes in STOMP( https://issues.redhat.com/browse/JGRP-2758
Browse files Browse the repository at this point in the history
)
  • Loading branch information
belaban committed Feb 12, 2024
1 parent d89a4a9 commit 4a98a3a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/org/jgroups/protocols/STOMP.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import java.util.function.Supplier;

/**
* Protocol which provides STOMP (http://stomp.codehaus.org/) support. Very simple implementation, with a
* Protocol which provides STOMP (https://stomp.github.io/) support. Very simple implementation, with a
* one-thread-per-connection model. Use for a few hundred clients max.<p/>
* The intended use for this protocol is pub-sub with clients which handle text messages, e.g. stock updates,
* SMS messages to mobile clients, SNMP traps etc.<p/>
Expand Down Expand Up @@ -524,7 +524,7 @@ public void sendInfo() {
* @param response
* @param keys_and_values
*/
private void writeResponse(ServerVerb response, String ... keys_and_values) {
private synchronized void writeResponse(ServerVerb response, String ... keys_and_values) {
String tmp=response.name();
try {
out.write(tmp.getBytes());
Expand All @@ -544,7 +544,7 @@ private void writeResponse(ServerVerb response, String ... keys_and_values) {
}
}

private void writeResponse(byte[] response, int offset, int length) {
private synchronized void writeResponse(byte[] response, int offset, int length) {
try {
out.write(response, offset, length);
out.flush();
Expand Down

0 comments on commit 4a98a3a

Please sign in to comment.