@@ -71,7 +71,7 @@ protected Connection(final String host, final Integer port, final Integer timeou
71
71
this .sslContext = sslContext ;
72
72
}
73
73
74
- public synchronized boolean isOpen () {
74
+ public boolean isOpen () {
75
75
return socket != null && socket .isConnected () && !socket .isClosed ();
76
76
}
77
77
@@ -126,7 +126,7 @@ public synchronized void close() {
126
126
}
127
127
}
128
128
129
- private void sendProtocolHeader () throws IOException {
129
+ private synchronized void sendProtocolHeader () throws IOException {
130
130
if (LOGGER .isDebugEnabled ()) {
131
131
LOGGER .debug (String .format ("Send velocystream protocol header to %s" , socket ));
132
132
}
@@ -162,7 +162,7 @@ protected synchronized void writeIntern(final Message message, final Collection<
162
162
}
163
163
}
164
164
165
- private void writeChunkHead (final Chunk chunk ) throws IOException {
165
+ private synchronized void writeChunkHead (final Chunk chunk ) throws IOException {
166
166
final long messageLength = chunk .getMessageLength ();
167
167
final int headLength = messageLength > -1L ? ArangoDBConstants .CHUNK_MAX_HEADER_SIZE
168
168
: ArangoDBConstants .CHUNK_MIN_HEADER_SIZE ;
@@ -205,7 +205,7 @@ private ByteBuffer readBytes(final int len) throws IOException {
205
205
return ByteBuffer .wrap (buf ).order (ByteOrder .LITTLE_ENDIAN );
206
206
}
207
207
208
- protected void readBytesIntoBuffer (final byte [] buf , final int off , final int len ) throws IOException {
208
+ protected synchronized void readBytesIntoBuffer (final byte [] buf , final int off , final int len ) throws IOException {
209
209
for (int readed = 0 ; readed < len ;) {
210
210
final int read = inputStream .read (buf , off + readed , len - readed );
211
211
if (read == -1 ) {
0 commit comments