This commit is contained in:
crusader 2018-05-04 17:09:11 +09:00
parent d0ade4b90f
commit 76bbb882fa

View File

@ -1,6 +1,7 @@
package com.loafle.commons.server.websocket.client;
import java.net.SocketAddress;
import java.net.URI;
import java.util.List;
import org.slf4j.Logger;
@ -31,7 +32,7 @@ public class Client {
public static final String CHANNEL_CLASS = "CLIENT_CHANNEL_CLASS";
public static final String CHANNEL_HANDLERS = "CLIENT_CHANNEL_HANDLERS";
public static final String HANDSHAKER = "CLIENT_HANDSHAKER";
public static final String SOCKET_ADDRESS = "CLIENT_SOCKET_ADDRESS";
public static final String SERVER_URI = "CLIENT_SERVER_URI";
@Autowired
@Qualifier(CHANNEL_CLASS)
@ -43,8 +44,8 @@ public class Client {
@Qualifier(HANDSHAKER)
WebSocketClientHandshaker handshaker;
@Autowired
@Qualifier(SOCKET_ADDRESS)
protected SocketAddress address;
@Qualifier(SERVER_URI)
protected URI serverURI;
private Channel channel;
@ -75,7 +76,7 @@ public class Client {
});
this.init();
ChannelFuture cf = b.connect(this.address);
ChannelFuture cf = b.connect(serverURI.getHost(), serverURI.getPort());
this.onStart();
cf.sync();