Java Code Examples for org.springframework.messaging.tcp.TcpConnection#close()

The following examples show how to use org.springframework.messaging.tcp.TcpConnection#close() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StompBrokerRelayMessageHandler.java    From spring-analysis-note with MIT License 6 votes vote down vote up
/**
 * Clean up state associated with the connection and close it.
 * Any exception arising from closing the connection are propagated.
 */
public void clearConnection() {
	if (logger.isDebugEnabled()) {
		logger.debug("Cleaning up connection state for session " + this.sessionId);
	}

	if (this.isRemoteClientSession) {
		StompBrokerRelayMessageHandler.this.connectionHandlers.remove(this.sessionId);
	}

	this.isStompConnected = false;

	TcpConnection<byte[]> conn = this.tcpConnection;
	this.tcpConnection = null;
	if (conn != null) {
		if (logger.isDebugEnabled()) {
			logger.debug("Closing TCP connection in session " + this.sessionId);
		}
		conn.close();
	}
}
 
Example 2
Source File: StompBrokerRelayMessageHandler.java    From java-technology-stack with MIT License 6 votes vote down vote up
/**
 * Clean up state associated with the connection and close it.
 * Any exception arising from closing the connection are propagated.
 */
public void clearConnection() {
	if (logger.isDebugEnabled()) {
		logger.debug("Cleaning up connection state for session " + this.sessionId);
	}

	if (this.isRemoteClientSession) {
		StompBrokerRelayMessageHandler.this.connectionHandlers.remove(this.sessionId);
	}

	this.isStompConnected = false;

	TcpConnection<byte[]> conn = this.tcpConnection;
	this.tcpConnection = null;
	if (conn != null) {
		if (logger.isDebugEnabled()) {
			logger.debug("Closing TCP connection in session " + this.sessionId);
		}
		conn.close();
	}
}
 
Example 3
Source File: StompBrokerRelayMessageHandler.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
/**
 * Clean up state associated with the connection and close it.
 * Any exception arising from closing the connection are propagated.
 */
public void clearConnection() {
	if (logger.isDebugEnabled()) {
		logger.debug("Cleaning up connection state for session " + this.sessionId);
	}

	if (this.isRemoteClientSession) {
		StompBrokerRelayMessageHandler.this.connectionHandlers.remove(this.sessionId);
	}

	this.isStompConnected = false;

	TcpConnection<byte[]> conn = this.tcpConnection;
	this.tcpConnection = null;
	if (conn != null) {
		if (logger.isDebugEnabled()) {
			logger.debug("Closing TCP connection in session " + this.sessionId);
		}
		conn.close();
	}
}
 
Example 4
Source File: DefaultStompSession.java    From spring-analysis-note with MIT License 5 votes vote down vote up
private void resetConnection() {
	TcpConnection<?> conn = this.connection;
	this.connection = null;
	if (conn != null) {
		try {
			conn.close();
		}
		catch (Throwable ex) {
			// ignore
		}
	}
}
 
Example 5
Source File: DefaultStompSession.java    From java-technology-stack with MIT License 5 votes vote down vote up
private void resetConnection() {
	TcpConnection<?> conn = this.connection;
	this.connection = null;
	if (conn != null) {
		try {
			conn.close();
		}
		catch (Throwable ex) {
			// ignore
		}
	}
}
 
Example 6
Source File: DefaultStompSession.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
private void resetConnection() {
	TcpConnection<?> conn = this.connection;
	this.connection = null;
	if (conn != null) {
		try {
			conn.close();
		}
		catch (Throwable ex) {
			// Ignore
		}
	}
}