mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-15 18:12:35 +01:00
Fix mock socket client/server test.
Normally a server will bind to 0.0.0.0, which is not an address that a client can specify to connect to. 127.0.0.1 or ::1 will do.
This commit is contained in:
parent
5de9ae0bce
commit
b32b49e853
@ -58,7 +58,7 @@ public class MockServerTest extends TestCase {
|
||||
|
||||
Socket socket = SocketFactory.getDefault().createSocket();
|
||||
try {
|
||||
socket.connect(server.getAddress());
|
||||
socket.connect(new InetSocketAddress("127.0.0.1", server.getAddress().getPort()));
|
||||
|
||||
InputStream is = socket.getInputStream();
|
||||
OutputStream os = socket.getOutputStream();
|
||||
@ -127,7 +127,7 @@ public class MockServerTest extends TestCase {
|
||||
|
||||
Socket socket = SocketFactory.getDefault().createSocket();
|
||||
try {
|
||||
InetSocketAddress address = server.getAddress();
|
||||
InetSocketAddress address = new InetSocketAddress("127.0.0.1", server.getAddress().getPort());
|
||||
socket.connect(address);
|
||||
|
||||
// Send hello data over plain connection
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user