Example usage for org.springframework.integration.ip.tcp.connection TcpNioClientConnectionFactory setSingleUse

List of usage examples for org.springframework.integration.ip.tcp.connection TcpNioClientConnectionFactory setSingleUse

Introduction

In this page you can find the example usage for org.springframework.integration.ip.tcp.connection TcpNioClientConnectionFactory setSingleUse.

Prototype

public void setSingleUse(boolean singleUse) 

Source Link

Document

If true, sockets created by this factory will be used once.

Usage

From source file:com.acmemotors.Main.java

@Bean
public TcpNioClientConnectionFactory connectionFactory(@Value("${dongleHost:192.168.0.10}") String dongleHost,
        @Value("${donglePort:35000}") int donglePort) {
    TcpNioClientConnectionFactory factory;

    factory = new TcpNioClientConnectionFactory(dongleHost, donglePort);

    OBD2Serializer odb2Serializer = new OBD2Serializer();
    factory.setSerializer(odb2Serializer);
    factory.setDeserializer(odb2Serializer);
    factory.setSingleUse(false);
    factory.afterPropertiesSet();/*from  w  w  w  .ja v  a  2s.  com*/

    return factory;
}