private synchronized Response go( OutMessage msg, DBCollection coll, boolean forceReponse, ReadPreference readPref, DBDecoder decoder) throws IOException { if (_processingResponse) { if (coll == null) { // this could be a pipeline and should be safe } else { // this could cause issues since we're reading data off the wire throw new IllegalStateException( "DBPort.go called and expecting a response while processing another response"); } } _calls++; if (_socket == null) _open(); if (_out == null) throw new IllegalStateException("_out shouldn't be null"); try { msg.prepare(); msg.pipe(_out); if (_pool != null) _pool._everWorked = true; if (coll == null && !forceReponse) return null; _processingResponse = true; return new Response(_sa, coll, _in, (decoder == null ? _decoder : decoder)); } catch (IOException ioe) { close(); throw ioe; } finally { _processingResponse = false; } }