mirror of https://github.com/apache/cloudstack.git
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.
(cherry picked from commit 1e9f066df2)
Signed-off-by: Animesh Chaturvedi <animesh@apache.org>
This commit is contained in:
parent
a42a345684
commit
eece5100f0
|
|
@ -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…
Reference in New Issue