Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -23,6 +23,7 @@ import org.springframework.stereotype.Component;
|
|||||||
import java.io.DataInputStream;
|
import java.io.DataInputStream;
|
||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.net.InetSocketAddress;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -65,9 +66,16 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
try {
|
try {
|
||||||
String ip = paramService.findByCode(AcsConfig.ONEAGVURL).getValue();
|
String ip = paramService.findByCode(AcsConfig.ONEAGVURL).getValue();
|
||||||
int port = Integer.parseInt(paramService.findByCode(AcsConfig.ONEAGVPORT).getValue());
|
int port = Integer.parseInt(paramService.findByCode(AcsConfig.ONEAGVPORT).getValue());
|
||||||
socket = new Socket(ip, port);
|
|
||||||
|
InetSocketAddress socketAddress = new InetSocketAddress(ip, port);
|
||||||
|
|
||||||
|
socket = new Socket();
|
||||||
|
socket.connect(socketAddress,2*1000);
|
||||||
|
socket.setKeepAlive(true);//长链接
|
||||||
|
// s.setSoTimeout(1000* 60 * 10);//读取超时时间
|
||||||
dos = new DataOutputStream(socket.getOutputStream());
|
dos = new DataOutputStream(socket.getOutputStream());
|
||||||
dis = new DataInputStream(socket.getInputStream());
|
dis = new DataInputStream(socket.getInputStream());
|
||||||
|
|
||||||
byte[] bytes = new byte[256];
|
byte[] bytes = new byte[256];
|
||||||
int count;
|
int count;
|
||||||
int[] arr;
|
int[] arr;
|
||||||
|
|||||||
Reference in New Issue
Block a user