writeString(String str): synchronize using socket write lock to prevent split SAM messages
This commit is contained in:
@ -124,9 +124,13 @@ public abstract class SAMHandler implements Runnable {
|
|||||||
* @return True if the string was successfully written, false otherwise
|
* @return True if the string was successfully written, false otherwise
|
||||||
*/
|
*/
|
||||||
protected final boolean writeString(String str) {
|
protected final boolean writeString(String str) {
|
||||||
|
boolean success;
|
||||||
if (_log.shouldLog(Log.DEBUG))
|
if (_log.shouldLog(Log.DEBUG))
|
||||||
_log.debug("Sending the client: [" + str + "]");
|
_log.debug("Sending the client: [" + str + "]");
|
||||||
return writeString(str, socket);
|
synchronized (socketWLock) {
|
||||||
|
success = writeString(str, socket);
|
||||||
|
}
|
||||||
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean writeString(String str, SocketChannel out)
|
public static boolean writeString(String str, SocketChannel out)
|
||||||
|
Reference in New Issue
Block a user