public boolean connect(int sock, String ipaddr, int port) throws LowLinkException, CommunicationException, TransportLayerException{
        boolean result = false;
        String dest = null;
        
		if(!IPV4Address.isValidIp(ipaddr)){
			Vector<String> addrs = ((ApplicationLayerDevice)mParentStack.getParentNode()).resolve(ipaddr);
			if(addrs.size()>0){
				dest = addrs.get(0);
			}
		}
		else{
			dest = ipaddr;
		}
        
		if(dest != null){
	        jnSocket jnsock = get_socket(sock);
	        if(jnsock.type == jnSocket.TCP_socket){
	            jnsock.open_state = true;
	            jnsock.dst_IP = dest;
	            jnsock.dst_port = port;
	            result = mParentStack.TCP().connect(sock, dest, port);
	        }
	        else if(jnsock.type == jnSocket.UDP_socket){
	            jnsock.dst_IP = dest;
	            jnsock.dst_port = port;
	            result = true;
	        }
		}
        return result;
    }