Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions quickfixj-core/src/main/java/quickfix/SocketAcceptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,15 @@ public SocketAcceptor(SessionFactory sessionFactory, SessionSettings settings) t

@Override
public void start() throws ConfigError, RuntimeError {
initialize(true);
initialize();
}

private void initialize(boolean blockInThread) throws ConfigError {
private void initialize() throws ConfigError {
if (isStarted.equals(Boolean.FALSE)) {
eventHandlingStrategy.setExecutor(longLivedExecutor);
startAcceptingConnections();
isStarted = Boolean.TRUE;
if (blockInThread) {
eventHandlingStrategy.blockInThread();
} else {
eventHandlingStrategy.block();
}
eventHandlingStrategy.blockInThread();
} else {
log.warn("Ignored attempt to start already running SocketAcceptor.");
}
Expand Down
10 changes: 3 additions & 7 deletions quickfixj-core/src/main/java/quickfix/SocketInitiator.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public SocketInitiator(SessionFactory sessionFactory, SessionSettings settings,

@Override
public void start() throws ConfigError, RuntimeError {
initialize(true);
initialize();
}

@Override
Expand All @@ -131,7 +131,7 @@ public void stop(boolean forceDisconnect) {
}
}

private void initialize(boolean blockInThread) throws ConfigError {
private void initialize() throws ConfigError {
if (isStarted.equals(Boolean.FALSE)) {
eventHandlingStrategy.setExecutor(longLivedExecutor);
createSessionInitiators();
Expand All @@ -140,11 +140,7 @@ private void initialize(boolean blockInThread) throws ConfigError {
}
startInitiators();
isStarted = Boolean.TRUE;
if (blockInThread) {
eventHandlingStrategy.blockInThread();
} else {
eventHandlingStrategy.block();
}
eventHandlingStrategy.blockInThread();
} else {
log.warn("Ignored attempt to start already running SocketInitiator.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public SessionConnector getSessionConnector() {
return sessionConnector;
}

public void block() {
private void block() {
while (true) {
synchronized (this) {
if (isStopped) {
Expand Down