Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion jolie/src/main/java/jolie/net/SocketCommChannelFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.channels.SocketChannel;
import java.nio.channels.UnresolvedAddressException;

import jolie.net.ext.CommChannelFactory;
import jolie.net.ports.OutputPort;

Expand All @@ -42,7 +44,13 @@ public SocketCommChannelFactory( CommCore commCore ) {
@Override
public CommChannel createChannel( URI location, OutputPort port )
throws IOException {
SocketChannel channel = SocketChannel.open( new InetSocketAddress( location.getHost(), location.getPort() ) );

SocketChannel channel = null;
try {
channel = SocketChannel.open( new InetSocketAddress( location.getHost(), location.getPort() ) );
} catch( UnresolvedAddressException e ) {
throw new IOException( "Unable to resolve address: " + location.toString(), e );
}
SocketCommChannel ret = null;
try {
ret = new SocketCommChannel( channel, location, port.getProtocol() );
Expand Down
Loading