Skip to content

Commit

Permalink
Use unconnected socket in BlockingClient as before
Browse files Browse the repository at this point in the history
  • Loading branch information
devrandom authored and mikehearn committed Apr 27, 2014
1 parent 23da335 commit 9cfb420
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/com/google/bitcoin/net/BlockingClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ public BlockingClient(final SocketAddress serverAddress, final StreamParser pars
// sure it doesnt get too large or have to call read too often.
dbuf = ByteBuffer.allocateDirect(Math.min(Math.max(parser.getMaxMessageSize(), BUFFER_SIZE_LOWER_BOUND), BUFFER_SIZE_UPPER_BOUND));
parser.setWriteTarget(this);
socket = socketFactory.createSocket();
Thread t = new Thread() {
@Override
public void run() {
if (clientSet != null)
clientSet.add(BlockingClient.this);
try {
InetSocketAddress iServerAddress = (InetSocketAddress)serverAddress;
socket = socketFactory.createSocket(iServerAddress.getAddress(), iServerAddress.getPort());
//socket.connect(serverAddress, connectTimeoutMillis);
socket.connect(serverAddress, connectTimeoutMillis);
parser.connectionOpened();
InputStream stream = socket.getInputStream();
byte[] readBuff = new byte[dbuf.capacity()];
Expand Down

0 comments on commit 9cfb420

Please sign in to comment.