@Override
public Socket createTargetSideConnection(final String targetId, final Socket controlConnection,
final Message connectionRequestMessage) throws ConnectionNotEstablishedException {
// this.checkIfTargetIsInitialized();
try {
HolePunchingTarget target = new HolePunchingTarget(controlConnection, targetId);
logger.debug("Sending connection request response"); //$NON-NLS-1$
this.sendConnectionRequestResponse(controlConnection, connectionRequestMessage);
logger.debug("Starting hole punching target"); //$NON-NLS-1$
target.start(connectionRequestMessage);
logger.debug("Waiting for accepted socket"); //$NON-NLS-1$
return target.accept();
} catch (final Exception e) {
final String errorMessage = "Could not create target-side connection"; //$NON-NLS-1$
logger.error(errorMessage, e);
throw new ConnectionNotEstablishedException(this.metaData.getTraversalTechniqueName(), errorMessage, e);
}